This is the mail archive of the
mailing list for the glibc project.
Re: Finding the path of the current binary?
- From: Mike Hearn <mike at theoretic dot com>
- To: Roland McGrath <roland at redhat dot com>
- Cc: libc-alpha at sources dot redhat dot com
- Date: 07 Mar 2003 23:00:18 +0000
- Subject: Re: Finding the path of the current binary?
- References: <200303072224.h27MOVP22587@magilla.sf.frob.com>
> That's not really an unreasonable requirement. It would just be one
> argument to a general function.
I know, I know, I'm just difficult :) My real concern is that it's just
one more place to forget to change if you bump the soname.... a very
minor thing, but it'd be nice to avoid it if possible.
> But as has been pointed out, it's not
> really required because a function can be written that examines the
> _DYNAMIC table itself. If that function lives in another shared library,
> it needs to take &_DYNAMIC as an argument from code in the library that
> wants to know about itself.
Thanks, I'll have a play with this. Should be fine for now.
> > > That said, it might indeed be nice to have a library interface for
> > > substituting $ORIGIN and similar magic bits.
> > That would be idea really. Any idea how complex such a patch would be?
> Adding something to glibc would be trivial if an interface is chosen.
> The Solaris `dlinfo' interface looks reasonable at a glance. I could add that.
Yep, dlinfo looks good. Want me to file it in the redhat bugzilla, or is
that not the right place?