ld linking against wrong libs

Eirik Nygaard eirikn at kerneled.com
Thu Apr 7 10:00:15 PDT 2005


When using ld manually it links against the wrong lib as seen below.
This is only in the binutils 215 case, the old binutils works like it should.

== Paste
[eirik at shuttle]~/<1>test> cat ld.c
#include <stdio.h>

int
main(void)
{
        printf("Worked!\n");
        return(0);
}
[eirik at shuttle]~/<1>test> gcc -c ld.c
[eirik at shuttle]~/<1>test> /usr/libexec/binutils215/elf/ld /usr/lib/crt1.o -L/usr/lib -lc ld.o -o ld
[eirik at shuttle]~/<1>test> ldd ld
ld:
ELF interpreter /usr/lib/libc.so.1 not found
ld: signal 6
[eirik at shuttle]~/<1>test> /usr/libexec/binutils212/elf/ld /usr/lib/crt1.o -L/usr/lib -lc ld.o -o ld
[eirik at shuttle]~/<1>test> ldd ld
ld:
        libc.so.4 => /usr/lib/libc.so.4 (0x28073000)
== End paste

-- 
Eirik Nygaard





More information about the Bugs mailing list