2 # RUN: llvm-mc -filetype=obj -triple=i686 %s -o %t.o
3 # RUN: ld.lld -shared %t.o -o %t.so
4 # RUN: llvm-readobj --sections -r %t.so | FileCheck %s
5 # RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t.so | FileCheck %s --check-prefix=DIS
8 .section .tbss,"awT",@nobits
33 leal tls0@tlsgd
(,%ebx
,1),%eax
34 call __tls_get_addr@plt
36 leal tls1@tlsgd
(,%ebx
,1),%eax
37 call __tls_get_addr@plt
39 leal tls2@tlsldm
(%ebx
),%eax
40 call __tls_get_addr@plt
41 leal tls2@dtpoff
(%eax
),%edx
43 leal tls2@tlsldm
(%ebx
),%eax
44 call __tls_get_addr@plt
45 leal tls2@dtpoff+
4(%eax
),%edx
48 addl tls0@gotntpoff
(%ebx
),%eax
51 addl tls1@gotntpoff
(%ebx
),%eax
54 # CHECK-NEXT: Type: SHT_PROGBITS
56 # CHECK-NEXT: SHF_ALLOC
57 # CHECK-NEXT: SHF_WRITE
59 # CHECK-NEXT: Address: 0x2358
60 # CHECK-NEXT: Offset: 0x358
61 # CHECK-NEXT: Size: 32
64 # CHECK-NEXT: AddressAlignment: 4
65 # CHECK-NEXT: EntrySize: 0
67 # CHECK: Relocations [
68 # CHECK: Section ({{.+}}) .rel.dyn {
69 # CHECK-NEXT: 0x2358 R_386_TLS_DTPMOD32 -
70 # CHECK-NEXT: 0x2360 R_386_TLS_DTPMOD32 tls0
71 # CHECK-NEXT: 0x2364 R_386_TLS_DTPOFF32 tls0
72 # CHECK-NEXT: 0x2368 R_386_TLS_TPOFF tls0
73 # CHECK-NEXT: 0x236C R_386_TLS_DTPMOD32 tls1
74 # CHECK-NEXT: 0x2370 R_386_TLS_DTPOFF32 tls1
75 # CHECK-NEXT: 0x2374 R_386_TLS_TPOFF tls1
78 # DIS: Disassembly of section .text:
81 ## General dynamic model:
82 ## -4128 and -4116 are first and second GOT entries offsets.
83 ## Each one is a pair of records.
84 # DIS-NEXT: 1260: leal -4120(,%ebx), %eax
85 # DIS-NEXT: 1267: calll 0x12d0
86 # DIS-NEXT: 126c: leal -4108(,%ebx), %eax
87 # DIS-NEXT: 1273: calll 0x12d0
88 ## Local dynamic model:
89 ## -16 is a local module tls index offset.
90 # DIS-NEXT: 1278: leal -4128(%ebx), %eax
91 # DIS-NEXT: 127e: calll 0x12d0
92 # DIS-NEXT: 1283: leal 8(%eax), %edx
93 # DIS-NEXT: 1289: leal -4128(%ebx), %eax
94 # DIS-NEXT: 128f: calll 0x12d0
95 # DIS-NEXT: 1294: leal 12(%eax), %edx
96 ## Initial exec model:
97 # DIS-NEXT: 129a: movl %gs:0, %eax
98 # DIS-NEXT: 12a0: addl -4112(%ebx), %eax
99 # DIS-NEXT: 12a6: movl %gs:0, %eax
100 # DIS-NEXT: 12ac: addl -4100(%ebx), %eax