ld: warning: ld-linux.so.2, needed by /lib/libc.so.6, not found

Ron Arts ron.arts@neonova.nl
Sat Apr 26 14:39:00 GMT 2003


Hello,

We are creating a chrooted development environment, and
have the above error report when issuing the following command:

# cc -o nbs-bbnet nbs-bbnet.c
ld: warning: ld-linux.so.2, needed by /lib/libc.so.6, not found (try 
using -rpath or -rpath-link)
/lib/libc.so.6: undefined reference to 
`_dl_lookup_versioned_symbol_skip@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to `_rtld_global@GLIBC_PRIVATE'
/lib/libc.so.6: undefined reference to
(etc)

Now, ld is called as follows by `cc`:

ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o nbs-bbnet
  /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o
  /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crti.o
  /usr/lib/gcc-lib/i386-redhat-linux/2.96/crtbegin.o
  -L/usr/lib/gcc-lib/i386-redhat-linux/2.96
  -L/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../.. /tmp/gASdsdfggS
  -lgcc -lc -lgcc /usr/lib/gcc-lib/i386-redhat-linux/2.96/crtend.o
  /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crtn.o

The funny thing is, when I add -rpath-link /lib to the above
statement, the linking succeeds. I guess something is wrong
in our setup, but how do I go about finding it?

strace'ing does not give me any clues. It looks as if `ld` is
only looking for ld-linux.so in the directory 
/usr/i386-redhat-linux/lib/.  According to the documentation
ld should always look in /lib and /usr/lib, but for some
reason it doesn't.

Anyone can think of a reason for this strange behaviour?

Ron

-- 
NeoNova BV
bedrijfsmatige internetoplossingen

http://www.neonova.nl   Kruislaan 419              1098 VA Amsterdam
info: 020-5628292       servicedesk: 020-5628292   fax: 020-5628291



More information about the Binutils mailing list