executable RPATH question

Matthew Fortune Matthew.Fortune at imgtec.com
Mon Feb 9 12:35:22 UTC 2015


Bernhard Reutner-Fischer <rep.dot.nop at gmail.com> writes:
> On February 6, 2015 8:23:27 AM GMT+01:00, Waldemar Brodkorb
> <wbx at openadk.org> wrote:
> >Hi Steve,
> >Steve Ellcey  wrote,
> >
> >> While building uclibc for MIPS I ran into the issue of whether or not
> >> the dynamic linker should use an executables rpath when searching for
> >> its libraries.  Apparently the glibc dynamic linker does this, but
> >the
> >> uclibc one does not and back when this was discussed in 2011 the
> >decision
> >> was made not to change the uclibc behaviour because the ELF spec does
> >not
> >> say that the linker should do this.
> >>
> >> At the risk of of reopening a closed issue I was wondering if we
> >could
> >> consider putting the code to do this in under an ifdef or a config
> >option
> >> so that those of us who want it could have it without having to
> >maintain
> >> a local patch for it.  If not, I will just maintain my local patch.
> >>
> >> Original discussion:
> >>
> >> http://lists.uclibc.org/pipermail/uclibc/2011-September/045757.html
> >
> >Do you have a patch which applies to master?
> >Including an option...
> 
> I still think this is wrong. Just set the RUNPATH of the first lib
> correctly (and fix glibc):

There are unfortunately plenty of cases where a de-facto standard ends up
being relied upon. It is not possible to force all application developers
to change the way they work to ensure that their programs will be compatible
with the strictest dynamic linker.

Would it not be better to be more compatible with other Linux C libraries
than stick firmly to the ELF spec? It is highly likely that developers no
longer rely on the behaviour as written in the spec as their program
would not work with glibc. It sounds like you would need a relatively
contrived set of dependencies, with identically names libraries appearing
in multiple places, before you could actually notice any difference.

Thanks,
Matthew

> http://www.sco.com/developers/gabi/latest/ch5.dynamic.html#shobj_dependenc
> ies
> 
> The set of directories specified by a given DT_RUNPATH entry is used to
> find only the immediate dependencies of the executable or shared object
> containing the DT_RUNPATH entry. That is, it is used only for those
> dependencies contained in the DT_NEEDED entries of the dynamic structure
> containing the DT_RUNPATHentry, itself. One object's DT_RUNPATHentry does
> not affect the search for any other object's dependencies.



More information about the uClibc mailing list