2 // RUN
: llvm-mc
-filetype
=obj
-triple
=aarch64-pc-linux
%s
-o
%t.o
3 // RUN
: ld.lld
--hash-style
=sysv
-shared
%t.o
-o
%t.so
4 // RUN
: llvm-objdump
--no-print-imm-hex
-d
--no-show-raw-insn
%t.so | FileCheck
%s
5 // RUN
: llvm-readobj
-r
%t.so | FileCheck
--check-prefix
=REL
%s
9 ldr x1
, [x0
, :tlsdesc_lo12
:a]
10 add x0
, x0
, :tlsdesc_lo12
:a
14 // Create relocation against local TLS symbols where linker should
15 // create target specific dynamic TLSDESC relocation where addend is
16 // the symbol VMA in tls block.
18 // CHECK
: 10298: adrp x0
, 0x20000
19 // CHECK-NEXT
: 1029c
: ldr x1
, [x0
, #856]
20 // CHECK-NEXT
: 102a0
: add x0
, x0
, #856
21 // CHECK-NEXT
: 102a4
: blr x1
23 adrp x0
, :tlsdesc
:local1
24 ldr x1
, [x0
, :tlsdesc_lo12
:local1
]
25 add x0
, x0
, :tlsdesc_lo12
:local1
29 // CHECK
: 102a8
: adrp x0
, 0x20000
30 // CHECK-NEXT
: 102ac
: ldr x1
, [x0
, #872]
31 // CHECK-NEXT
: 102b0
: add x0
, x0
, #872
32 // CHECK-NEXT
: 102b4
: blr x1
34 adrp x0
, :tlsdesc
:local2
35 ldr x1
, [x0
, :tlsdesc_lo12
:local2
]
36 add x0
, x0
, :tlsdesc_lo12
:local2
40 // CHECK
: 102b8
: adrp x0
, 0x20000
41 // CHECK-NEXT
: 102bc: ldr x1
, [x0
, #888]
42 // CHECK-NEXT
: 102c0
: add x0
, x0
, #888
43 // CHECK-NEXT
: 102c4
: blr x1
45 .section .tbss,"awT",@nobits
59 // 0x1000 + 4096 + 160 = 0x20A0
60 // 0x1000 + 4096 + 176 = 0x20B0
61 // 0x1000 + 4096 + 144 = 0x2090
63 // R_AARCH64_TLSDESC
- 0x0 -> start of tls block
64 // R_AARCH64_TLSDESC
- 0x8 -> align
(sizeof
(local1
), 8)
67 // REL-NEXT
: Section
(4) .rela.dyn {
68 // REL-NEXT
: 0x20368 R_AARCH64_TLSDESC
- 0x0
69 // REL-NEXT
: 0x20378 R_AARCH64_TLSDESC
- 0x8
70 // REL-NEXT
: 0x20358 R_AARCH64_TLSDESC
a 0x0