This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/34475] New: TLS and PIE don't mix on x86-64
- From: "drepper at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Dec 2007 07:26:51 -0000
- Subject: [Bug target/34475] New: TLS and PIE don't mix on x86-64
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Compiling this little program as a PIE leads to problems on x86-64:
$ cat w.c
__thread int a;
int
main(void)
{
return a;
}
Using
gcc -o w -g -O2 -pie -fpie w.c
one sees
/usr/bin/ld: /tmp/ccU3JvLp.o: relocation R_X86_64_TPOFF32 against `a' can not
be used when making a shared object; recompile with -fPIC
R_X86_64_TPOFF32 is the correct relocation to use for non-PIC binaries but PIEs
must be PIC. It's probably just a simple mistake where instead of testing for
PIC vs non-PIC the test checks for executable vs DSO.
This is no regression. It also exists in gcc 4.1 (the oldest version available
here).
--
Summary: TLS and PIE don't mix on x86-64
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: drepper at redhat dot com
GCC host triplet: x86_64-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34475