When NPTL libraries are used, I get a linker assertion failure. To reproduce on Fedora 2: [hjl@gnu errno]$ cat bug.c extern int errno; int main () { printf("errno=%d",errno); return 0; } [hjl@gnu errno]$ gcc bug.c -L/usr/lib/nptl collect2: ld terminated with signal 11 [Segmentation fault] /usr/local/bin/ld: BFD 2.15.92.0.2 20040927 assertion fail /export/linux/src/binutils/binutils/bfd/elflink.c:6123
The problem is there is no-TLS access to TLS symbol.
Created attachment 209 [details] A testcase [hjl@gnu tls-4]$ make cc -c -o x.o x.c cc -fPIC -shared -o libfoo.so foo.c cc -Wl,-rpath,. x.o libfoo.so -o x collect2: ld terminated with signal 11 [Segmentation fault] /usr/local/bin/ld: BFD 2.15.92.0.2 20040927 assertion fail /export/linux/src/binutils/binutils/bfd/elflink.c:6123 make: *** [x] Error 1
A patch is posted at http://sources.redhat.com/ml/binutils/2004-09/msg00299.html
*** Bug 189 has been marked as a duplicate of this bug. ***
http://sources.redhat.com/ml/binutils-cvs/2004-09/msg00148.html