Since there is no TLS IE transition, allow R_386_TLS_LE_32 with KMOVD.
gas/
PR gas/28595
* config/tc-i386.c (i386_assemble): Remove BFD_RELOC_386_TLS_LE_32
from TLS code check.
* testsuite/gas/i386/inval-tls.s: Remove foo@tpoff(%eax).
* testsuite/gas/i386/inval-tls.l: Updated.
ld/
PR gas/28595
* testsuite/ld-i386/i386.exp: Run tlsle1.
* testsuite/ld-i386/tlsle1.d: New file.
* testsuite/ld-i386/tlsle1.s: Likewise.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
return;
}
- /* Don't allow e.g. KMOV in TLS code sequences. */
+ /* Don't allow e.g. KMOV in TLS code sequences which will trigger
+ linker error later. */
for (j = i.imm_operands; j < i.operands; ++j)
switch (i.reloc[j])
{
case BFD_RELOC_X86_64_GOTTPOFF:
case BFD_RELOC_386_TLS_GOTIE:
- case BFD_RELOC_386_TLS_LE_32:
case BFD_RELOC_X86_64_TLSLD:
as_bad (_("TLS relocation cannot be used with `%s'"), insn_name (&i.tm));
return;
.*: Assembler messages:
.*:3: Error: .* `kmovd'
-.*:4: Error: .* `kmovd'
.text
# All the following should be illegal
kmovd foo@gotntpoff(%eax), %k0
- kmovd foo@tpoff(%eax), %k0
run_dump_test "tlsie3"
run_dump_test "tlsie4"
run_dump_test "tlsie5"
+run_dump_test "tlsle1"
run_dump_test "hidden1"
run_dump_test "hidden2"
run_dump_test "hidden3"
--- /dev/null
+#name: TLS LE with kmovd
+#as: --32
+#ld: -melf_i386
+#objdump: -dw
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+0+8049000 <_start>:
+ +[a-f0-9]+: 65 c4 e1 f9 90 05 04 00 00 00 kmovd %gs:0x4,%k0
+ +[a-f0-9]+: c4 e1 f9 90 80 04 00 00 00 kmovd 0x4\(%eax\),%k0
+ +[a-f0-9]+: 65 c4 e1 f9 90 05 fc ff ff ff kmovd %gs:0xfffffffc,%k0
+ +[a-f0-9]+: c4 e1 f9 90 80 fc ff ff ff kmovd -0x4\(%eax\),%k0
+#pass
--- /dev/null
+ .text
+ .globl _start
+_start:
+ kmovd %gs:foo@tpoff,%k0
+ kmovd foo@tpoff(%eax),%k0
+ kmovd %gs:foo@ntpoff,%k0
+ kmovd foo@ntpoff(%eax),%k0
+ .globl foo
+ .section .tdata,"awT",@progbits
+ .align 4
+ .type foo, @object
+ .size foo, 4
+foo:
+ .long 100