This is the mail archive of the
mailing list for the glibc project.
Re: Binary apps linked against libdl
- To: Christopher Seawood <firstname.lastname@example.org>
- Subject: Re: Binary apps linked against libdl
- From: Andreas Jaeger <email@example.com>
- Date: 23 Apr 1999 07:11:36 +0200
- Cc: firstname.lastname@example.org
- Mail-Copies-To: never
- References: <Pine.LNX.3.95.990422161456.23012Aemail@example.com>
>>>>> Christopher Seawood writes:
Christopher> On 22 Apr 1999, Andreas Jaeger wrote:
>> >>>>> Christopher Seawood writes:
>> >> > sh: error in loading shared libraries: /usr/glibc2.0/lib/libc.so.6:
>> >> > undefined symbol: _dl_global_scope_end
>> You're mixing /lib/ld-linux.so.2 which is hardcoded into every binary
>> with another libdl.so.2 which isn't hardcoded:
Christopher> Doh! So I am. :-< I'm still confused as to why running the application
Christopher> explicitly using the glibc2.0 ld-linux.so.2 does not work. From what
Christopher> you've said and what I pasted before, it appears as though it's looking
Christopher> for the 2.0.7 libdl but is complaining that the libdl it gets (apparently,
Christopher> the glibc 2.1.1 one) is missing _dl_global_scope_end.
It gets the 2.0.7 libdl.so but the 2.1.1 ld-linux.so.2. - and that's
the problem. ld-linux.so defines some symbols!
Christopher> If db2inst execs /bin/sh (which it expects to be ksh), will ksh also use
Christopher> the glibc 2.0.7 ld-linux.so.2 or does the environment get reset on the
Christopher> (presumed) execve() or system()?
LD_LIBRARY_PATH=/usr/glibc2.0/lib /usr/glibc2.0/lib/ld-linux.so.2 ./db2inst
and the glibc 2.0 dynamic linker and the libraries from glibc 2.0 are
used. Everything fine. But now db2inst calls /bin/sh with
LD_LIBRARY_PATH still set but with /lib/ld-linux.so.2. The
environment isn't reset - and /lib/ld-linux.so.2 is used since it's
hardcoded into the binary. -> this gives the broken result since
ld-linux and libraries from different versions can't be mixed.
If you would call:
/usr/glibc2.0/lib/ld-linux.so.2 --library-path /usr/glibc2.0/lib ./db2inst
only db2inst would be executed with glibc 2.0 libraries and /bin/sh
would use the normal libraries.
There's no way to pass information about a different dynamic linker to
children. You can only pass the LD_LIBRARY_PATH.
- LD_LIBRARY_PATH is read by the dynamic linker ld-linux.so
- each binary contains a hardcoded path to /lib/ld-linux.so.2 which is
executed by the kernel.
Andreas Jaeger firstname.lastname@example.org email@example.com
for pgp-key finger firstname.lastname@example.org