This is the mail archive of the libc-alpha@sourceware.org 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: dlopen/RPATH/RUNPATH


> This doesn't seem right to me.  If I go to the trouble of setting
> up an -rpath, why wouldn't you want dlopen() to respect it?

That is not what it's for.  You are talking about a global setting, and the
purpose of -rpath is for satisfying the dependencies of the thing you are
linking with -rpath.  If any DT_RUNPATH setting were to have this global
effect, it would pollute the search paths of the whole executable with the
private settings for one DSO to find its own dependencies.

> Regardless, if dlopen() is considered correct as is, how could
> I query the -rpath at runtime from within the application so that
> I can emulate the behavior I desire?  

I think what you really want to do is simply not rely on the search path
for your dlopen.  Pass dlopen a name like "$ORIGIN/../lib/libmine.so.1".
(Names containing /s are not subject to the search path.)



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