Bug 414 - Linker crashes with mixed TLS/non-TLS symbols
Summary: Linker crashes with mixed TLS/non-TLS symbols
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: H.J. Lu
URL:
Keywords:
: 189 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-09-29 16:24 UTC by H.J. Lu
Modified: 2004-10-01 12:05 UTC (History)
2 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Last reconfirmed:


Attachments
A testcase (407 bytes, application/octet-stream)
2004-09-29 16:42 UTC, H.J. Lu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2004-09-29 16:24:30 UTC
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
Comment 1 H.J. Lu 2004-09-29 16:41:15 UTC
The problem is there is no-TLS access to TLS symbol.
Comment 2 H.J. Lu 2004-09-29 16:42:39 UTC
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
Comment 3 H.J. Lu 2004-09-29 17:48:24 UTC
A patch is posted at

http://sources.redhat.com/ml/binutils/2004-09/msg00299.html
Comment 4 Pawel Sikora 2004-09-30 08:12:05 UTC
*** Bug 189 has been marked as a duplicate of this bug. ***