This is the mail archive of the libc-alpha@sources.redhat.com 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: LD_PRELOAD and dlopen


"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


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