Bug 9938 - TLS transition from R_386_TLS_GD to R_386_TLS_IE_32 error when compiling gettext-0.17
Summary: TLS transition from R_386_TLS_GD to R_386_TLS_IE_32 error when compiling gett...
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.20
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-10 16:19 UTC by Niki W. Waibel
Modified: 2009-03-12 17:15 UTC (History)
2 users (show)

See Also:
Host: i386-pc-solaris2.10
Target: i386-pc-solaris2.10
Build: i386-pc-solaris2.10
Last reconfirmed:


Attachments
from /misc/i386-pc-solaris2.10/opt/gcc/4.3.3/lib/gcc/i386-pc-solaris2.10/4.3.3/libgomp.a (8.81 KB, application/octet-stream)
2009-03-11 09:25 UTC, Niki W. Waibel
Details
of loop.o (13.35 KB, text/plain)
2009-03-11 09:32 UTC, Niki W. Waibel
Details
linker inputs, part1of3 (972.54 KB, application/octet-stream)
2009-03-12 11:14 UTC, Niki W. Waibel
Details
linker inputs, part2of3 (976.43 KB, application/octet-stream)
2009-03-12 11:16 UTC, Niki W. Waibel
Details
linker inputs, part3of3 (371.30 KB, application/octet-stream)
2009-03-12 11:16 UTC, Niki W. Waibel
Details
additional files (130.03 KB, application/octet-stream)
2009-03-12 16:09 UTC, Niki W. Waibel
Details
gcc -v output (987 bytes, text/plain)
2009-03-12 16:21 UTC, Niki W. Waibel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Niki W. Waibel 2009-03-10 16:19:12 UTC
when compiling gettext-0.17 on i386-pc-solaris2.10 with gcc-4.3.3 and
binutils-2.19.50.0.1, i get:
===
gcc -std=gnu99 -fopenmp -fPIC -Wall -O2 -Wl,--enable-new-dtags -Wl,--rpath
-Wl,/misc/i386-pc-solaris2.10/lib -o .libs/msgmerge msgmerge-msgmerge.o
msgmerge-msgl-fsearch.o msgmerge-plural-count.o -fopenmp 
-L/misc/i386-pc-solaris2.10/lib ./.libs/libgettextsrc.so
/tmp/gettext-0.17/gettext-tools/gnulib-lib/.libs/libgettextlib.so -lncurses
/tmp/gettext-0.17/gettext-tools/intl/.libs/libintl.so -liconv -lc -lm -lsec 
-Wl,--rpath -Wl,/misc/i386-pc-solaris2.10/opt/gettext/0.17/lib
/misc/i386-pc-solaris2.10/bin/ld:
/misc/i386-pc-solaris2.10/opt/gcc/4.3.3/lib/gcc/i386-pc-solaris2.10/4.3.3/libgomp.a(loop.o):
TLS transition from R_386_TLS_GD to R_386_TLS_IE_32 against `gomp_tls_data' at
0x1b in section `.text' failed
/misc/i386-pc-solaris2.10/opt/gcc/4.3.3/lib/gcc/i386-pc-solaris2.10/4.3.3/libgomp.a:
could not read symbols: Bad value
collect2: ld returned 1 exit status
make[4]: *** [msgmerge] Error 1
make[4]: Leaving directory `/tmp/gettext-0.17/gettext-tools/src'
make[3]: *** [all] Error 2
===

i can't use binutils-2.19.51.0.2 yet, because of bug#521 (currently being worked
on) ... not sure if this is somehow related (not an binutils expert -- just a
user) ... not sure if this is a gcc problem also.
Comment 1 Niki W. Waibel 2009-03-10 17:24:18 UTC
it seems, if i compile gettext-0.17 with --disable-openmp, i am fine (libgomp.a
is simply not used).

--disable-openmp is a good workaround for gettext, but maybe someone can figure
out why ld is producing this error when linking against libgomp.a of gcc.
Comment 2 H.J. Lu 2009-03-10 18:00:05 UTC
Please provide loop.o in libgomp.a.
Comment 3 H.J. Lu 2009-03-10 18:04:59 UTC
Please also provide loop.s.
Comment 4 Niki W. Waibel 2009-03-11 09:25:39 UTC
Created attachment 3809 [details]
from /misc/i386-pc-solaris2.10/opt/gcc/4.3.3/lib/gcc/i386-pc-solaris2.10/4.3.3/libgomp.a
Comment 5 Niki W. Waibel 2009-03-11 09:32:09 UTC
Created attachment 3810 [details]
of loop.o
Comment 6 H.J. Lu 2009-03-11 16:45:35 UTC
loop.o and loop.s look OK. If you can provide complete linker inputs
with command line options so that I can reproduce it on Linux with
a cross linker, I will take a look.
Comment 7 Niki W. Waibel 2009-03-12 11:14:27 UTC
Created attachment 3811 [details]
linker inputs, part1of3

hope these are all files you need. just tell if you need something else.

exact commandline was:
===
gcc -std=gnu99 -fopenmp -Wall -O2 -Wl,--enable-new-dtags -Wl,--rpath
-Wl,/misc/i386-pc-solaris2.10/lib -o .libs/msgmerge msgmerge-msgmerge.o
msgmerge-msgl-fsearch.o msgmerge-plural-count.o -fopenmp 
-L/misc/i386-pc-solaris2.10/lib ./.libs/libgettextsrc.so
/tmp/gettext-0.17/gettext-tools/gnulib-lib/.libs/libgettextlib.so -lncurses
/tmp/gettext-0.17/gettext-tools/intl/.libs/libintl.so -liconv -lc -lm -lsec 
-Wl,--rpath -Wl,/misc/i386-pc-solaris2.10/opt/gettext/0.17/lib
===

and produced:
===
/misc/i386-pc-solaris2.10/bin/ld:
/misc/i386-pc-solaris2.10/opt/gcc/4.3.3/lib/gcc/i386-pc-solaris2.10/4.3.3/libgomp.a(loop.o):
TLS transition from R_386_TLS_GD to R_386_TLS_IE_32 against `gomp_tls_data' at
0x1b in section `.text' failed
/misc/i386-pc-solaris2.10/opt/gcc/4.3.3/lib/gcc/i386-pc-solaris2.10/4.3.3/libgomp.a:
could not read symbols: Bad value
===
Comment 8 Niki W. Waibel 2009-03-12 11:16:09 UTC
Created attachment 3812 [details]
linker inputs, part2of3
Comment 9 Niki W. Waibel 2009-03-12 11:16:49 UTC
Created attachment 3813 [details]
linker inputs, part3of3
Comment 10 H.J. Lu 2009-03-12 14:03:38 UTC
(In reply to comment #7)
> Created an attachment (id=3811)
> linker inputs, part1
> 
> hope these are all files you need. just tell if you need something else.
> 

That is not enough. Please use "gcc -v" to see what files are
passed to linker. I need every single linker input file.
Comment 11 Niki W. Waibel 2009-03-12 16:09:42 UTC
Created attachment 3814 [details]
additional files

sorry. i am really not a gcc/binutils expert. thanks for the -v hint and thanks
for great support!

see the attached file. hope it contains now all missing files you need.
Comment 12 H.J. Lu 2009-03-12 16:12:08 UTC
(In reply to comment #11)
> Created an attachment (id=3814)
> additional files
> 
> sorry. i am really not a gcc/binutils expert. thanks for the -v hint and thanks
> for great support!

Please provide the output of "gcc -v" so that I can run linker
with the same set of inputs.
Comment 13 Niki W. Waibel 2009-03-12 16:21:52 UTC
Created attachment 3815 [details]
gcc -v output

thank you for being so patience with me ;-)
Comment 14 cvs-commit@gcc.gnu.org 2009-03-12 17:14:19 UTC
Subject: Bug 9938

CVSROOT:	/cvs/src
Module name:	src
Changes by:	hjl@sourceware.org	2009-03-12 17:13:42

Modified files:
	bfd            : ChangeLog elf32-i386.c elf64-x86-64.c 

Log message:
	2009-03-12  H.J. Lu  <hongjiu.lu@intel.com>
	
	PR ld/9938
	* elf32-i386.c (elf_i386_check_tls_transition): Use strncmp
	to check ___tls_get_addr.
	
	* elf64-x86-64.c (elf64_x86_64_check_tls_transition): Use
	strncmp to check __tls_get_addr.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&r1=1.4495&r2=1.4496
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/elf32-i386.c.diff?cvsroot=src&r1=1.192&r2=1.193
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/elf64-x86-64.c.diff?cvsroot=src&r1=1.151&r2=1.152

Comment 15 H.J. Lu 2009-03-12 17:15:54 UTC
It is fixed by

http://sourceware.org/ml/binutils/2009-03/msg00233.html

The same fix can be used in binutils-2.19.50.0.1.