[math...@mathieu-laptop elf-loader]$ ld --version
GNU ld version 2.19.51.0.2-17.fc11 20090204
[math...@mathieu-laptop test]$ gcc -dumpmachine
x86_64-redhat-linux
[math...@mathieu-laptop test]$ gcc --version
gcc (GCC) 4.4.0 20090506 (Red Hat 4.4.0-4)
[math...@mathieu-laptop test]$ uname -a
Linux mathieu-laptop 2.6.29.5-191.fc11.x86_64 #1 SMP Tue Jun 16
23:23:21 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

testcase:

[math...@mathieu-laptop test]$ cat >test.c
__thread int g_a;

int main (int argc, char *argv[])
{
 g_a = 0;
 return 0;
}

[math...@mathieu-laptop test]$ gcc -fpie -pie ./test.c -o test
/usr/bin/ld: /tmp/ccsIE4YR.o: relocation R_X86_64_TPOFF32 against
`g_a' can not be used when making a shared object; recompile with
-fPIC
/tmp/ccsIE4YR.o: could not read symbols: Bad value
collect2: ld returned 1 exit status

The above works with "gcc -fpic -pie ./test.c -o test" (which, I know, is not
really supported).

-- 
           Summary: -fpie + -pie does not appear to work with __thread
                    variables
           Product: binutils
           Version: 2.19
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: mathieu dot lacage at gmail dot com
                CC: bug-binutils at gnu dot org
  GCC host triplet: x86_64-redhat-linux


http://sourceware.org/bugzilla/show_bug.cgi?id=10434

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to