ld: warning: ld-linux.so.2, needed by /lib/libc.so.6, not found
Daniel Jacobowitz
drow@mvista.com
Sat Apr 26 22:33:00 GMT 2003
On Sat, Apr 26, 2003 at 04:38:59PM +0200, Ron Arts wrote:
> 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?
Probably ld doesn't think it's a native linker. If it thinks it's a
cross linker it will default tonot searching host directories, of
course.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
More information about the Binutils
mailing list