glibc and $ORIGIN

Ryan Arnold ryan.arnold@gmail.com
Tue May 5 22:22:00 GMT 2009


On Tue, May 5, 2009 at 5:19 PM, Ryan Arnold <ryan.arnold@gmail.com> wrote:

> There are ways to get around this but they're not for the faint of
> heart.  The following wiki shows how one can tell the compiler that
> the loader lives elsewhere:
>
> http://sources.redhat.com/glibc/wiki/Testing/Builds
>
> And one can debug using the following trick:
>
> http://sources.redhat.com/glibc/wiki/Debugging/Development_Debugging#head-0f2b610260f23db5655a16e911aa7134c6bcc0ba
>
> Most people only use this for debugging GLIBC builds.  I don't
> recommend it for production environments unless the entire toolchain
> is standalone.
>
> A better alternative is a chroot jail with GLIBC installed into the
> chroot / directory.

Oh, now I see you want no absolute paths.. That's not going to work.
The ELF executable your run has the absolute loader path embedded in
the ELF header in the INTERP section:

http://sources.redhat.com/glibc/wiki/Tips_and_Tricks/Loader_Tips_and_Tricks

As far as I know the kernel always loads this loader unless you invoke
the target loader FIRST and direct the loader to load the application.

Ryan



More information about the Libc-help mailing list