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]

using different ld-linux.so.2


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.

-- 


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