2 // RUN
: llvm-mc
%s
-o
%t.o
-filetype
=obj
-triple
=armv7a-linux-gnueabi
3 // RUN
: ld.lld
%t.o
-o
%t.so
-shared
4 // RUN
: llvm-readobj
-S
--dyn-relocations
%t.so | FileCheck
--check-prefix
=SEC
%s
5 // RUN
: llvm-objdump
-d
--triple
=armv7a-linux-gnueabi
%t.so | FileCheck
%s
7 /// Test the handling of the global-dynamic TLS model. Dynamic Loader finds
8 /// module index R_ARM_TLS_DTPMOD32
and the offset within the module
9 /// R_ARM_TLS_DTPOFF32. One of the variables is hidden which permits relaxation
26 /// Generate R_ARM_TLS_GD32 relocations
27 /// Allocates
a pair of GOT entries dynamically relocated by R_ARM_TLS_DTPMOD32
28 /// and R_ARM_TLS_DTPOFF32 respectively. The literal contains the offset of the
29 /// first GOT entry from the place
30 .Lt0: .word x(TLSGD) + (. - .L0 - 8)
31 .Lt1: .word y(TLSGD) + (. - .L1 - 8)
32 .Lt2: .word z(TLSGD) + (. - .L2 - 8)
34 /// __thread int x
= 10
36 /// __thread int z __attribute
((visibility
("hidden")))
43 .section .tbss,"awT",%nobits
52 .section .tdata,"awT",%progbits
59 // SEC-NEXT
: Type
: SHT_PROGBITS
61 // SEC-NEXT
: SHF_ALLOC
63 // SEC-NEXT
: SHF_WRITE
65 // SEC-NEXT
: Address
: 0x20210
68 // SEC-NEXT
: Type
: SHT_NOBITS
70 // SEC-NEXT
: SHF_ALLOC
72 // SEC-NEXT
: SHF_WRITE
74 // SEC-NEXT
: Address
: 0x20214
78 // SEC-NEXT
: Type
: SHT_PROGBITS
80 // SEC-NEXT
: SHF_ALLOC
81 // SEC-NEXT
: SHF_WRITE
83 // SEC-NEXT
: Address
: 0x20264
86 // SEC
: Dynamic Relocations
{
87 // SEC-NEXT
: 0x20274 R_ARM_TLS_DTPMOD32
-
88 // SEC-NEXT
: 0x20264 R_ARM_TLS_DTPMOD32 x
89 // SEC-NEXT
: 0x20268 R_ARM_TLS_DTPOFF32 x
90 // SEC-NEXT
: 0x2026C R_ARM_TLS_DTPMOD32 y
91 // SEC-NEXT
: 0x20270 R_ARM_TLS_DTPOFF32 y
94 // CHECK-LABEL
: 000101f8 <func
>:
95 // CHECK-NEXT
: 101f8: e320f000
nop
96 // CHECK-NEXT
: 101fc
: e320f000
nop
97 // CHECK-NEXT
: 10200: e320f000
nop
99 /// (0x20264 - 0x1204) + (0x10204 - 0x101f8 - 8) = 0x1f064
100 // CHECK
: 10204: 64 00 01 00
101 /// (0x2026c - 0x10204) + (0x10204 - 0x101fc - 8) = 0x10068
102 // CHECK-NEXT
: 10208: 68 00 01 00
103 /// (0x20274 - 0x10204) + (0x10204 - 0x10200 - 8) = 0x1006c
104 // CHECK-NEXT
: 1020c
: 6c
00 01 00