using different ld-linux.so.2
John Reiser
jreiser@BitWagon.com
Wed Mar 8 14:47:00 GMT 2006
Guillaume Duranceau <guillaume.duranceau@bull.net>:
>>> The problem is that my_program can call execve, which loads an other binary
>>> with the original ld-linux.so.2. Is there an easy way to override the
>>> system loader ld-linux.so.2 with /newglibc/lib/ld-linux.so.2 even for
>>> my_program chidren processes ?
Mike Frysinger <vapier@gentoo.org>:
> not without rebuilding each one ... just link your programs with:
> -Wl,-dynamic-linker,/newglibc/lib/ld-linux.so.2 -Wl,-rpath,/newglibc/lib
If it is not convenient to re-build the children, then add another level
of indirection. Rename a child to something else, or move it to another
directory. Create a #! executable shell script at the original child
pathname, and have the script invoke the child using the new ld-linux.
This can be done directly:
#!/bin/sh
exec /newglibc/lib/ld-linux.so.2 /new/directory/original_child "$@"
or semi-automatically by using an indirect runtime loader, as described in
http://BitWagon.com/rtldi/rtldi.html . The indirect method preserves
the "process name" as seen by programs such as ps, top, etc.
--
More information about the Libc-alpha
mailing list