Finding the path of the current binary?
Andreas Schwab
schwab@suse.de
Fri Mar 7 21:59:00 GMT 2003
Mike Hearn <mike@theoretic.com> writes:
|> On Fri, 2003-03-07 at 20:18, Roland McGrath wrote:
|> > You can use the DT_DEBUG slot or just the _r_debug symbol, to find the the
|> > `r_map' member giving the head of the struct link_map list (see <link.h>).
|> > Then l_name in each struct link_map gives you the file name that was opened.
|>
|> Doesn't that require the library knows its own soname?
It does, it's part of the ABI and referenced from the dynamic table in the
DT_SONAME slot. The dynamic table itself is reachable via _DYNAMIC.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
More information about the Libc-alpha
mailing list