https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116043
H.J. Lu <hjl.tools at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|link-failure |wrong-code --- Comment #10 from H.J. Lu <hjl.tools at gmail dot com> --- (In reply to Richard Biener from comment #8) > (In reply to H.J. Lu from comment #7) > > Linker only allows mov and add for @gottpoff(%rip). > > Though LEA might indeed be a reasonable additional opcode? What do these do: leaq __libc_tsd_CTYPE_B@gottpoff(%rip), %rax vmovq (%rax), %xmm0 >From x86-64 TLS psABI: The assembler generates for the x@gottpoff(%rip) expressions a R X86 64 GOTTPOFF relocation for the symbol x which requests the linker to generate a GOT entry with a R X86 64 TPOFF64 relocation. The offset of the GOT entry relative to the end of the instruction is then used in the instruction. The R X86 64 TPOFF64 relocation is pro- cessed at program startup time by the dynamic linker by looking up the symbol x in the modules loaded at that point. The offset is written in the GOT entry and later loaded by the addq instruction. The above code sequence looks wrong to me.