This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: How is ld-linux.so.2 [re]located?
- From: Mike Frysinger <vapier at gentoo dot org>
- To: Tom Brown <sa212+glibc at cyconix dot com>
- Cc: libc-help <libc-help at sourceware dot org>
- Date: Tue, 22 Mar 2011 10:07:06 -0400
- Subject: Re: How is ld-linux.so.2 [re]located?
- References: <4D88A956.407@cyconix.com>
On Tue, Mar 22, 2011 at 9:51 AM, Tom Brown wrote:
> I've done some googling, and found others with the same problem, but no
> solution. Does anyone have any idea how I can persuade the 2.96 version of
> the tools to generate an executable that loads
> /opt/gcc-2.96/lib/ld-linux.so.2, instead of /lib/ld-linux.so.2?
the interp path is hardcoded in the binary because the kernel needs
it, and userspace cant specify a search path.
http://sourceware.org/glibc/wiki/Tips_and_Tricks/Loader_Tips_and_Tricks
so manually specify the path yourself. move the binary from "xxx" to
"xxx.bin", and put a wrapper script at "xxx" which does:
#!/bin/sh
/path/to/other/interp --library-path otherlibdirs "$0.bin" "$@"
you can see an example here:
http://sourceware.org/glibc/wiki/Testing/Builds
-mike