From owner-cvs-all Wed Sep 16 01:05:59 1998 Return-Path: Received: (from daemon@localhost) by hub.freebsd.org (8.8.8/8.8.8) id BAA26621 for cvs-all-outgoing; Wed, 16 Sep 1998 01:05:59 -0700 (PDT) (envelope-from owner-cvs-all) Received: from nlsystems.com (nlsys.demon.co.uk [158.152.125.33]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id BAA26588; Wed, 16 Sep 1998 01:05:48 -0700 (PDT) (envelope-from dfr@nlsystems.com) Received: from herring.nlsystems.com (herring.nlsystems.com [10.0.0.2]) by nlsystems.com (8.9.1/8.8.5) with SMTP id JAA03278; Wed, 16 Sep 1998 09:05:06 +0100 (BST) Date: Wed, 16 Sep 1998 09:05:06 +0100 (BST) From: Doug Rabson To: John Polstra cc: cvs-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/libexec/rtld-elf rtld.c In-Reply-To: <199809160254.TAA12359@freefall.freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Tue, 15 Sep 1998, John Polstra wrote: > jdp 1998/09/15 19:54:10 PDT > > Modified files: > libexec/rtld-elf rtld.c > Log: > Fix a bug that showed up when debugging dynamically linked programs. > References from GDB to "printf" and various other functions would > find the versions in the dynamic linker itself, rather than the > versions in the program's libc. This fix moves the GDB link map > entry for the dynamic linker to the end of the search list, where > its symbols will be found only if they are not found anywhere else. > It was suggested by Doug Rabson, though I implemented it a little > differently. > > I personally would prefer to leave the dynamic linker's entry out > of the GDB search list altogether. But Doug argues that it is > handy there for such things as setting breakpoints on dlopen(). > So it stays for now, at least. > > Note, if we ever integrate the dynamic linker with libc (which has > several important benefits to recommend it), this whole problem > goes away. I have been able to debug the whole rtld startup from _rtld() onwards, including relocatiing rtld itself and loading the main program's libraries. Having gdb able to see rtld's symbols is invaluable when working on this code. -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 181 951 1891 Fax: +44 181 381 1039