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
6 // RUN
: ld.lld
%t.o
-o
%t
7 // RUN
: llvm-objdump
-d
--triple
=armv7a-linux-gnueabi
%t | FileCheck
--check-prefix
=CHECK-EXE
%s
9 /// Test the handling of the local-dynamic TLS model. Dynamic loader finds
10 /// module index R_ARM_TLS_DTPMOD32. The offset in the next GOT slot is
0
11 /// The R_ARM_TLS_LDO is the offset of the variable within the TLS block.
12 .global __tls_get_addr
18 .type _start, %function
23 .word x(tlsldm) + (. - .L0 - 8)
27 .section .tbss,"awT",%nobits
32 .section .tdata,"awT",%progbits
39 // SEC-NEXT
: Type
: SHT_PROGBITS
41 // SEC-NEXT
: SHF_ALLOC
43 // SEC-NEXT
: SHF_WRITE
45 // SEC-NEXT
: Address
: 0x201D0
48 // SEC-NEXT
: Type
: SHT_NOBITS
(0x8)
50 // SEC-NEXT
: SHF_ALLOC
52 // SEC-NEXT
: SHF_WRITE
54 // SEC-NEXT
: Address
: 0x201D4
57 // SEC
: Dynamic Relocations
{
58 // SEC-NEXT
: 0x20224 R_ARM_TLS_DTPMOD32
-
60 // CHECK
: Disassembly of section
.text:
62 // CHECK-NEXT
: <_start
>:
63 // CHECK-NEXT
: 101c0
: e320f000
nop
65 /// (0x20224 - 0x101c4) + (0x101c4 - 0x101c0 - 8) = 0x1005c
66 // CHECK
: 101c4
: 5c
00 01 00
67 // CHECK-NEXT
: 101c8
: 00 00 00 00
68 // CHECK-NEXT
: 101cc
: 04 00 00 00
70 // CHECK-EXE
: <_start
>:
71 // CHECK-EXE-NEXT
: 20114: e320f000
nop
72 // CHECK-EXE
: 20118: 0c
00 01 00
73 // CHECK-EXE-NEXT
: 2011c
: 00 00 00 00
74 // CHECK-EXE-NEXT
: 20120: 04 00 00 00