1 // RUN
: llvm-mc
-triple
=powerpc64le-pc-linux
-filetype
=obj
%s
-o
- | \
2 // RUN
: llvm-readobj
-r | FileCheck
%s
4 // RUN
: llvm-mc
-triple
=powerpc64-pc-linux
-filetype
=obj
%s
-o
- | \
5 // RUN
: llvm-readobj
-r | FileCheck
%s
7 // Verify we can handle all the dtprel symbol modifiers for local-dynamic tls.
8 // Tests
a 16 bit offset on both DS-form
and D-form instructions
, 32 bit
9 // adjusted
and non-adjusted offsets
, and 64 bit adjusted
and non-adjusted
16 .type short_offset,@function
19 addis 2, 12, .TOC.-.Lfunc_gep0@ha
20 addi 2, 2, .TOC.-.Lfunc_gep0@l
22 .localentry short_offset, .Lfunc_lep0-.Lfunc_gep0
26 addis 3, 2, i@got@tlsld@ha
27 addi 3, 3, i@got@tlsld@
l
28 bl __tls_get_addr
(i@tlsld
)
41 .type medium_offset,@function
44 addis 2, 12, .TOC.-.Lfunc_gep1@ha
45 addi 2, 2, .TOC.-.Lfunc_gep1@l
47 .localentry medium_offset, .Lfunc_lep1-.Lfunc_gep1
51 addis 3, 2, i@got@tlsld@ha
52 addi 3, 3, i@got@tlsld@
l
53 bl __tls_get_addr
(i@tlsld
)
55 addis 3, 3, i@dtprel@ha
62 .globl medium_not_adjusted
64 .type medium_not_adjusted,@function
67 addis 2, 12, .TOC.-.Lfunc_gep2@ha
68 addi 2, 2, .TOC.-.Lfunc_gep2@l
70 .localentry medium_not_adjusted, .Lfunc_lep2-.Lfunc_gep2
74 addis 3, 2, i@got@tlsld@ha
75 addi 3, 3, i@got@tlsld@
l
76 bl __tls_get_addr
(i@tlsld
)
88 .type large_offset,@function
91 addis 2, 12, .TOC.-.Lfunc_gep3@ha
92 addi 2, 2, .TOC.-.Lfunc_gep3@l
94 .localentry large_offset, .Lfunc_lep3-.Lfunc_gep3
98 addis 3, 2, i@got@tlsld@ha
99 addi 3, 3, i@got@tlsld@
l
100 bl __tls_get_addr
(i@tlsld
)
102 lis 4, i@dtprel@highesta
103 ori 4, 4, i@dtprel@highera
105 addis 4, 4, i@dtprel@higha
106 addi 4, 4, i@dtprel@
l
115 .type not_adjusted,@function
118 addis 2, 12, .TOC.-.Lfunc_gep4@ha
119 addi 2, 2, .TOC.-.Lfunc_gep4@l
121 .localentry not_adjusted, .Lfunc_lep4-.Lfunc_gep4
125 addis 3, 2, i@got@tlsld@ha
126 addi 3, 3, i@got@tlsld@
l
127 bl __tls_get_addr
(i@tlsld
)
129 lis 4, i@dtprel@highest
130 ori 4, 4, i@dtprel@higher
132 oris 4, 4, i@dtprel@high
141 .section .tdata,"awT",@progbits
154 # CHECK: Relocations [
155 # CHECK: Section {{.*}} .rela.text {
156 # CHECK: 0x{{[0-9A-F]+}} R_PPC64_GOT_TLSLD16_HA i
157 # CHECK: 0x{{[0-9A-F]+}} R_PPC64_GOT_TLSLD16_LO i
158 # CHECK: 0x{{[0-9A-F]+}} R_PPC64_TLSLD i
159 # CHECK: 0x{{[0-9A-F]+}} R_PPC64_REL24 __tls_get_addr
160 # CHECK: 0x{{[0-9A-F]+}} R_PPC64_DTPREL16_DS i
161 # CHECK: 0x{{[0-9A-F]+}} R_PPC64_DTPREL16 i
162 # CHECK: 0x{{[0-9A-F]+}} R_PPC64_DTPREL16_HA i
163 # CHECK: 0x{{[0-9A-F]+}} R_PPC64_DTPREL16_LO_DS i
164 # CHECK: 0x{{[0-9A-F]+}} R_PPC64_DTPREL16_HI i
165 # CHECK: 0x{{[0-9A-F]+}} R_PPC64_DTPREL16_HIGHESTA i
166 # CHECK: 0x{{[0-9A-F]+}} R_PPC64_DTPREL16_HIGHERA i
167 # CHECK: 0x{{[0-9A-F]+}} R_PPC64_DTPREL16_HIGHA i
168 # CHECK: 0x{{[0-9A-F]+}} R_PPC64_DTPREL16_LO i
169 # CHECK: 0x{{[0-9A-F]+}} R_PPC64_DTPREL16_HIGHEST i
170 # CHECK: 0x{{[0-9A-F]+}} R_PPC64_DTPREL16_HIGHER i
171 # CHECK: 0x{{[0-9A-F]+}} R_PPC64_DTPREL16_HIGH i
172 # CHECK: 0x{{[0-9A-F]+}} R_PPC64_DTPREL16_LO i
174 # CHECK: Section {{.*}} .rela.data {
175 # CHECK: 0x{{[0-9A-F]+}} R_PPC64_DTPREL64 i