This is the mail archive of the 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]

Re: Binary apps linked against libdl

>>>>> Christopher Seawood writes:

Christopher> On 22 Apr 1999, Andreas Jaeger wrote:
>> >>>>> Christopher Seawood writes:
>> >> > sh: error in loading shared libraries: /usr/glibc2.0/lib/
>> >> > undefined symbol: _dl_global_scope_end
>> You're mixing /lib/ which is hardcoded into every binary
>> with another 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 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 but the 2.1.1 - and that's
the problem. 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 or does the environment get reset on the
Christopher> (presumed) execve() or system()?  

You're running:
LD_LIBRARY_PATH=/usr/glibc2.0/lib /usr/glibc2.0/lib/ ./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/  The
environment isn't reset - and /lib/ 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/ --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.

Please note:
- LD_LIBRARY_PATH is read by the dynamic linker
- each binary contains a hardcoded path to /lib/ which is 
  executed by the kernel.

 Andreas Jaeger
  for pgp-key finger

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