From owner-freebsd-stable Wed Oct 25 10:43:49 2000 Delivered-To: freebsd-stable@freebsd.org Received: from mail.wgate.com (mail.wgate.com [38.219.83.4]) by hub.freebsd.org (Postfix) with ESMTP id 60C9337B4CF; Wed, 25 Oct 2000 10:43:45 -0700 (PDT) Received: from jesup.eng.tvol.net ([10.32.2.26]) by mail.wgate.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id VT2X9MXV; Wed, 25 Oct 2000 13:43:44 -0400 Reply-To: Randell Jesup To: Warner Losh Cc: obrien@FreeBSD.ORG, Max Khon , freebsd-stable@FreeBSD.ORG Subject: Re: GDB 4.18 and shared libraries (Mozilla) References: <20000919103436.B94601@dragon.nuxi.com> <20000920005447.B97385@dragon.nuxi.com> <200010180000.SAA13097@harmony.village.org> From: Randell Jesup Date: 25 Oct 2000 13:46:50 -0400 In-Reply-To: Warner Losh's message of "Tue, 17 Oct 2000 18:00:32 -0600" Message-ID: User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Warner Losh writes: >In message Randell Jesup writes: >: Well, personally, as a _user_ of FreeBSD, I don't care who has the >: finger pointed at them, or who claims "it isn't _our_ bug". I care that no >: one can debug a program that uses shared libraries under -STABLE, and I >: care when it will be fixed. I don't consider a system I have to patch the >: loader in order to debug my code to be "STABLE". > >No one is arguing with you that there is a bug. It is a matter of >finding someone to fix it. Fixing it isn't hard... This fix works just fine. From: "Bruce Bauman" Subject: linker bug in FreeBSD 4.x X-Sent: 6 weeks, 5 days, 21 hours, 55 minutes, 49 seconds ago There is a bug which is present in all 4.x (and 5.x) versions of FreeBSD which makes it difficult to debug code in shared libraries. I will place a new binary on io in ~wgate/ld.shlib-fix. You need to copy this to /usr/libexec/elf/ld (after saving the previous version of ld), and rebuild any shared libraries which you wish to debug. If you do a "make world", you will clobber this change, so beware! -- Bruce -- Bruce Here is a relevant source diff which fixes the bug: =================================================================== RCS file: /cvs/src/src/bfd/elf32-i386.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- src/bfd/elf32-i386.c 2000/03/01 19:40:53 1.8 +++ src/bfd/elf32-i386.c 2000/04/20 05:37:05 1.9 @@ -1291,7 +1291,9 @@ sections against symbols defined externally in shared libraries. We can't do anything with them here. */ - || (input_section->flags & SEC_DEBUGGING) != 0))) + || ((input_section->flags & SEC_DEBUGGING) != 0 + && (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC) != 0)))) { /* In these cases, we don't need the relocation value. We check specially because in some -- Randell Jesup, Worldgate Communications, ex-Scala, ex-Amiga OS team ('88-94) rjesup@wgate.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message