https://sourceware.org/bugzilla/show_bug.cgi?id=32022

            Bug ID: 32022
           Summary: Assembler shouldn't accept invalid TLS instructions
           Product: binutils
           Version: 2.44 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gas
          Assignee: unassigned at sourceware dot org
          Reporter: hjl.tools at gmail dot com
                CC: lili.cui at intel dot com
  Target Milestone: ---
            Target: x86

TLS relocations can only be used with specific instructions as specified in TLS
psABI and linker issues an error when TLS relocations are used with wrong
instructions.
Otherwise, compiler bugs may go undetected as shown in

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116043

Assembler shouldn't allow TLS relocations on wrong instructions:

[hjl@gnu-tgl-3 tmp]$ cat y.s
        .text
        xorq    foo@GOTTPOFF(%rip), %rax
        movq    (%rax), %rax
        .globl  foo
        .section        .tdata,"awT",@progbits
        .align 4
        .type   foo, @object
        .size   foo, 4
foo:
        .long   100
[hjl@gnu-tgl-3 tmp]$ gcc -c y.s
[hjl@gnu-tgl-3 tmp]$ ld y.o
ld: warning: cannot find entry symbol _start; defaulting to 0000000000401000
ld: y.o: TLS transition from R_X86_64_GOTTPOFF to R_X86_64_TPOFF32 against
`foo' at 0x3 in section `.text' failed
ld: final link failed: bad value
[hjl@gnu-tgl-3 tmp]$

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to