From owner-freebsd-hackers Sun Jan 18 14:31:31 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA20514 for hackers-outgoing; Sun, 18 Jan 1998 14:31:31 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp03.primenet.com (smtp03.primenet.com [206.165.6.133]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA20389 for ; Sun, 18 Jan 1998 14:30:21 -0800 (PST) (envelope-from tlambert@usr04.primenet.com) Received: (from daemon@localhost) by smtp03.primenet.com (8.8.8/8.8.8) id PAA00106; Sun, 18 Jan 1998 15:30:14 -0700 (MST) Received: from usr04.primenet.com(206.165.6.204) via SMTP by smtp03.primenet.com, id smtpd029963; Sun Jan 18 15:30:04 1998 Received: (from tlambert@localhost) by usr04.primenet.com (8.8.5/8.8.5) id PAA04997; Sun, 18 Jan 1998 15:30:03 -0700 (MST) From: Terry Lambert Message-Id: <199801182230.PAA04997@usr04.primenet.com> Subject: Re: dladdr hax To: jdp@polstra.com (John Polstra) Date: Sun, 18 Jan 1998 22:30:02 +0000 (GMT) Cc: tlambert@primenet.com, hackers@FreeBSD.ORG In-Reply-To: <199801182223.OAA15844@austin.polstra.com> from "John Polstra" at Jan 18, 98 02:23:03 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk > > You aren't going to get what you probably thought you were going to > > get; spcifically, the libc symbol names will actually give you the > > address of the stub function linked from the shared library into the > > main program, not the address of the function in the C library. > > Yes, I know. That's why I wanted to see the output. I wanted to see > whether Solaris bothered to resolve those to their true addresses. > > > I pointed that out with my first test program and output (very > > similar to yours). > > Sorry, I didn't see that. I think the answers are slightly different between x86 and SPARC, as well. I would have to drive a bit (the weather here is currently terrible) to verify this. I think it has to do with the PLT implementation. I may be wrong; but it's kind of irrelevent anyway. The magic thing is that if you call it from *within* a shared library, the shared library can get to itself and know where it is located. This would actually be a *really* useful thing to do for name resolver which worked by finding .so's near the library so you could add arbitrary name spaces (X.25, ISO, XNS, SMB, etc.). It would also be useful for a "libauth" or something similar to implement PAM better than PAM implements it. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.