This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Finding the path of the current binary?


> Doesn't that require the library knows its own soname? 

That's not really an unreasonable requirement.  It would just be one
argument to a general function.  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.

> > 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]