3 // RUN
: llvm-mc
-filetype
=obj
-triple
=powerpc64le-unknown-linux
%s
-o
%t.o
4 // RUN
: llvm-readelf
-r
%t.o | FileCheck
--check-prefix
=InputRelocs
%s
5 // RUN
: ld.lld
%t.o
-o
%t
6 // RUN
: llvm-objdump
-d
--no-show-raw-insn
%t | FileCheck
--check-prefix
=Dis
%s
7 // RUN
: llvm-readelf
-r
%t | FileCheck
--check-prefix
=OutputRelocs
%s
9 // RUN
: llvm-mc
-filetype
=obj
-triple
=powerpc64-unknown-linux
%s
-o
%t.o
10 // RUN
: llvm-readelf
-r
%t.o | FileCheck
--check-prefix
=InputRelocs
%s
11 // RUN
: ld.lld
%t.o
-o
%t
12 // RUN
: llvm-objdump
-d
--no-show-raw-insn
%t | FileCheck
--check-prefix
=Dis
%s
13 // RUN
: llvm-readelf
-r
%t | FileCheck
--check-prefix
=OutputRelocs
%s
17 .globl _start # -- Begin function _start
19 .type _start,@function
23 addis 2, 12, .TOC.-.Lfunc_gep0@ha
24 addi 2, 2, .TOC.-.Lfunc_gep0@l
26 .localentry _start, .Lfunc_lep0-.Lfunc_gep0
33 std 30, 48(31) # 8-byte Folded Spill
36 addis 3, 2, a@got@tlsld@ha
37 addi 3, 3, a@got@tlsld@
l
38 bl __tls_get_addr
(a@tlsld
)
40 addis 3, 3, a@dtprel@ha
44 ld 30, 48(31) # 8-byte Folded Reload
53 .size _start, .Lfunc_end0-.Lfunc_begin0
57 .section .tdata,"awT",@progbits
63 // Verify that the input has local-dynamic tls relocation types
64 // InputRelocs
: Relocation section
'.rela.text'
65 // InputRelocs
: R_PPC64_GOT_TLSLD16_HA
{{0+}} a + 0
66 // InputRelocs
: R_PPC64_GOT_TLSLD16_LO
{{0+}} a + 0
67 // InputRelocs
: R_PPC64_TLSLD
{{0+}} a + 0
69 // Verify that the local-dynamic sequence is relaxed to local exec.
72 // Dis
: addis 3, 13, 0
74 // Dis
: addi 3, 3, 4096
76 // #ha(a@dtprel) --> (0x0 -0x8000 + 0x8000) >> 16 = 0
77 // #lo(a@dtprel) --> (0x0 -0x8000) = -0x8000 = -32768
79 // Dis
: addi 3, 3, -32768
81 // Verify that no local-dynamic relocations exist for the dynamic linker.
82 // OutputRelocs-
NOT: R_PPC64_DTPMOD64