2 // RUN
: llvm-mc
-filetype
=obj
-triple
=x86_64-unknown-linux
%s
-o
%t
3 // RUN
: ld.lld
--hash-style
=sysv
-shared
%t -o
%tout
4 // RUN
: llvm-readobj
--sections
-r
%tout | FileCheck
%s
5 // RUN
: llvm-objdump
--no-print-imm-hex
-d
%tout | FileCheck
%s
--check-prefix
=DIS
7 leaq
a@tlsld
(%rip
), %rdi
8 callq __tls_get_addr@PLT
9 leaq
b@tlsld
(%rip
), %rdi
10 callq __tls_get_addr@PLT
11 leaq
a@dtpoff
(%rax
), %rcx
12 leaq
b@dtpoff
(%rax
), %rcx
14 leaq c@tlsgd
(%rip
), %rdi
16 callq __tls_get_addr@PLT
17 leaq
a@dtpoff
(%rax
), %rcx
18 // Initial Exec Model Code Sequence
, II
19 movq c@gottpoff
(%rip
),%rax
21 movabs $
a@dtpoff
, %rax
22 movabs $
b@dtpoff
, %rax
23 movabs $
a@dtpoff
, %rax
27 .section .tbss,"awT",@nobits
32 .section .tbss,"awT",@nobits
37 .section .tbss,"awT",@nobits
42 // Get the address of the got
, and check that it has
4 entries.
45 // CHECK
: Name
: .got (
46 // CHECK-NEXT
: Type
: SHT_PROGBITS
47 // CHECK-NEXT
: Flags
[
48 // CHECK-NEXT
: SHF_ALLOC
49 // CHECK-NEXT
: SHF_WRITE
51 // CHECK-NEXT
: Address
: 0x24A0
52 // CHECK-NEXT
: Offset
:
53 // CHECK-NEXT
: Size
: 40
55 // CHECK
: Relocations
[
56 // CHECK
: Section
({{.+}}) .rela.dyn {
57 // CHECK-NEXT
: 0x24A0 R_X86_64_DTPMOD64
- 0x0
58 // CHECK-NEXT
: 0x24B0 R_X86_64_DTPMOD64 c
0x0
59 // CHECK-NEXT
: 0x24B8 R_X86_64_DTPOFF64 c
0x0
60 // CHECK-NEXT
: 0x24C0 R_X86_64_TPOFF64 c
0x0
63 // 4457 = (0x24A0 + -4) - (0x1330 + 3) // PC relative offset to got entry.
64 // 4445 = (0x24B0 + -4) - (0x133c + 3) // PC relative offset to got entry.
65 // 4427 = (0x24B8 + -4) - (0x135e + 3) // PC relative offset to got entry.
66 // 4423 = (0x24C0 + -4) - (0x1372 + 3) // PC relative offset to got entry.
68 // DIS
: Disassembly of section
.text:
71 // DIS-NEXT
: 1330: {{.+}} leaq 4457(%rip), %rdi
72 // DIS-NEXT
: {{.+}} callq
73 // DIS-NEXT
: 133c
: {{.+}} leaq 4445(%rip), %rdi
74 // DIS-NEXT
: {{.+}} callq
75 // DIS-NEXT
: {{.+}} leaq (%rax), %rcx
76 // DIS-NEXT
: {{.+}} leaq 4(%rax), %rcx
81 // DIS-NEXT
: 135e
: {{.+}} leaq 4427(%rip), %rdi
82 // DIS-NEXT
: {{.+}} callq
83 // DIS-NEXT
: {{.+}} leaq (%rax), %rcx
84 // DIS-NEXT
: 1372: {{.+}} movq 4423(%rip), %rax
85 // DIS-NEXT
: {{.+}} movq %fs:(%rax), %rax
86 // DIS-NEXT
: {{.+}} movabsq $0, %rax
87 // DIS-NEXT
: {{.+}} movabsq $4, %rax
88 // DIS-NEXT
: {{.+}} movabsq $0, %rax