http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58067

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 30646
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30646&action=edit
gnu largepic TLS

An attempt to handle -mcmodel=large -fpic TLS GD/LD in the compiler.
Seems to work for me on testcase like:
__thread int a;
static __thread int b;

int
foo ()
{
  return a++ + b++;
}

int
main ()
{
  return foo () + foo () - 2;
}

but unfortunately ld will fail if this code is being attempted to link into an
executable or PIE:
/usr/bin/ld: /tmp/ccWao1Is.o: TLS transition from R_X86_64_TLSGD to
R_X86_64_GOTTPOFF against `a' at 0x26 in section `.text' failed
/tmp/ccWao1Is.o: could not read symbols: Bad value
collect2: error: ld returned 1 exit status

Reply via email to