2 # RUN: llvm-mc -filetype=obj -triple=i686 %s -o %t.o
3 # RUN: ld.lld %t.o -o %t
4 # RUN: ld.lld %t.o -pie -o %t.pie
5 # RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t | FileCheck %s --check-prefix=DIS
6 # RUN: llvm-readobj -r %t | FileCheck %s --check-prefix=RELOC
7 # RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t.pie | FileCheck %s --check-prefix=DIS
8 # RUN: llvm-readobj -r %t.pie | FileCheck %s --check-prefix=RELOC
10 ## Reject local-exec TLS relocations for -shared.
11 # RUN: not ld.lld -shared %t.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=ERR --implicit-check-not=error:
13 # ERR: error: relocation R_386_TLS_LE_32 against var cannot be used with -shared
14 # ERR: error: relocation R_386_TLS_LE_32 against var1 cannot be used with -shared
15 # ERR: error: relocation R_386_TLS_LE against var cannot be used with -shared
16 # ERR: error: relocation R_386_TLS_LE against var1 cannot be used with -shared
18 .section ".tdata", "awT", @progbits
32 movl $var1@tpoff
, %edx
37 leal var@ntpoff
(%ecx
), %eax
39 leal var1@ntpoff+
123(%ecx
), %eax
41 # DIS: Disassembly of section test:
44 # DIS-NEXT: movl $8, %edx
45 # DIS-NEXT: movl %gs:0, %ecx
46 # DIS-NEXT: subl %edx, %eax
47 # DIS-NEXT: movl $4, %edx
48 # DIS-NEXT: movl %gs:0, %ecx
49 # DIS-NEXT: subl %edx, %eax
50 # DIS-NEXT: movl %gs:0, %ecx
51 # DIS-NEXT: leal -8(%ecx), %eax
52 # DIS-NEXT: movl %gs:0, %ecx
53 # DIS-NEXT: leal 119(%ecx), %eax
55 # RELOC: Relocations [