This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: LD_PRELOAD and dlopen
- To: <stephen dot done at cw dot com>
- Subject: Re: LD_PRELOAD and dlopen
- From: Andreas Jaeger <aj at suse dot de>
- Date: 30 May 2001 06:59:53 +0200
- Cc: <libc-alpha at sources dot redhat dot com>
- References: <MOEKKPNMHCABCHMFENMEKEKOCDAA.stephen.done@cw.com>
"Stephen Done at home" <stephen.done@cw.com> writes:
n> Hi Andreas,
>
> That did indeed fix the problem. If you have time, could you give a very
> quick explanation of why, and also perhaps why gcc acted differently under
> Solaris with the 'undefined versioned symbol name dlopen@@GLIBC_2.1' error.
ld searches definitions in the order given on the command line.
So when you did:
gcc -Wall -ldl -fPIC -shared -o preload.so preload.c
/usr/bin/ld: preload.so: undefined versioned symbol name dlopen@@GLIBC_2.1
/usr/bin/ld: failed to set dynamic section sizes: Bad value
ld did not search in -ldl for missing function from preload.
Just run gcc -Wl,-verbose to see the difference and how ld works.
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj