[LLVMdev] problem with __thread on linux/x86_64

Jay Foad jay.foad at gmail.com
Thu Nov 11 05:22:06 PST 2010


On 11 November 2010 12:49, Jay Foad <jay.foad at gmail.com> wrote:
> Delving a bit deeper, the difference seems to be that symbol "i" in
> the assembler source:
>
>        .type   i, at object               # @i
>        .section        .tdata,"awT", at progbits
>        .globl  i
>        .align  4
> i:
>        .long   7                       # 0x7
>        .size   i, 4
>
> ... is given ELF symbol type STT_TLS by gcc's assembler, but
> STT_OBJECT by clang's assembler.

The .type directive should probably specify type "tls_object" rather
than just "object". But I think gas infers that this is a TLS symbol
anyway, because it is mentioned in TLS-related relocations. See this
thread and follow-ups:

http://www.cygwin.com/ml/binutils/2002-11/msg00409.html

Jay.




More information about the llvm-dev mailing list