• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-mc -arch=aarch64 -show-encoding < %s | FileCheck %s
2// RUN: llvm-mc -arch=aarch64 -filetype=obj < %s -o %t
3// RUN: elf-dump %t | FileCheck --check-prefix=CHECK-ELF %s
4// RUN: llvm-objdump -r %t | FileCheck --check-prefix=CHECK-ELF-NAMES %s
5
6// CHECK-ELF:  .rela.text
7
8        // TLS local-dynamic forms
9        movz x1, #:dtprel_g2:var
10        movn x2, #:dtprel_g2:var
11        movz x3, #:dtprel_g2:var
12        movn x4, #:dtprel_g2:var
13// CHECK: movz    x1, #:dtprel_g2:var     // encoding: [0x01'A',A,0xc0'A',0x92'A']
14// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_g2:var, kind: fixup_a64_movw_dtprel_g2
15// CHECK-NEXT: movn    x2, #:dtprel_g2:var     // encoding: [0x02'A',A,0xc0'A',0x92'A']
16// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_g2:var, kind: fixup_a64_movw_dtprel_g2
17// CHECK-NEXT: movz    x3, #:dtprel_g2:var     // encoding: [0x03'A',A,0xc0'A',0x92'A']
18// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_g2:var, kind: fixup_a64_movw_dtprel_g2
19// CHECK-NEXT: movn    x4, #:dtprel_g2:var     // encoding: [0x04'A',A,0xc0'A',0x92'A']
20// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_g2:var, kind: fixup_a64_movw_dtprel_g2
21
22// CHECK-ELF: # Relocation 0
23// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000000)
24// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM:0x[0-9a-f]+]])
25// CHECK-ELF-NEXT:  ('r_type', 0x0000020b)
26// CHECK-ELF: # Relocation 1
27// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000004)
28// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
29// CHECK-ELF-NEXT:  ('r_type', 0x0000020b)
30// CHECK-ELF: # Relocation 2
31// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000008)
32// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
33// CHECK-ELF-NEXT:  ('r_type', 0x0000020b)
34// CHECK-ELF: # Relocation 3
35// CHECK-ELF-NEXT: (('r_offset', 0x000000000000000c)
36// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
37// CHECK-ELF-NEXT:  ('r_type', 0x0000020b)
38
39// CHECK-ELF-NAMES: 0 R_AARCH64_TLSLD_MOVW_DTPREL_G2
40// CHECK-ELF-NAMES: 4 R_AARCH64_TLSLD_MOVW_DTPREL_G2
41// CHECK-ELF-NAMES: 8 R_AARCH64_TLSLD_MOVW_DTPREL_G2
42// CHECK-ELF-NAMES: 12 R_AARCH64_TLSLD_MOVW_DTPREL_G2
43
44        movz x5, #:dtprel_g1:var
45        movn x6, #:dtprel_g1:var
46        movz w7, #:dtprel_g1:var
47        movn w8, #:dtprel_g1:var
48// CHECK: movz    x5, #:dtprel_g1:var     // encoding: [0x05'A',A,0xa0'A',0x92'A']
49// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_g1:var, kind: fixup_a64_movw_dtprel_g1
50// CHECK-NEXT: movn    x6, #:dtprel_g1:var     // encoding: [0x06'A',A,0xa0'A',0x92'A']
51// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_g1:var, kind: fixup_a64_movw_dtprel_g1
52// CHECK-NEXT: movz    w7, #:dtprel_g1:var     // encoding: [0x07'A',A,0xa0'A',0x12'A']
53// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_g1:var, kind: fixup_a64_movw_dtprel_g1
54// CHECK-NEXT: movn    w8, #:dtprel_g1:var     // encoding: [0x08'A',A,0xa0'A',0x12'A']
55// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_g1:var, kind: fixup_a64_movw_dtprel_g1
56
57// CHECK-ELF: # Relocation 4
58// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000010)
59// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
60// CHECK-ELF-NEXT:  ('r_type', 0x0000020c)
61// CHECK-ELF: # Relocation 5
62// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000014)
63// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
64// CHECK-ELF-NEXT:  ('r_type', 0x0000020c)
65// CHECK-ELF: # Relocation 6
66// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000018)
67// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
68// CHECK-ELF-NEXT:  ('r_type', 0x0000020c)
69// CHECK-ELF: # Relocation 7
70// CHECK-ELF-NEXT: (('r_offset', 0x000000000000001c)
71// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
72// CHECK-ELF-NEXT:  ('r_type', 0x0000020c)
73
74// CHECK-ELF-NAMES: 16 R_AARCH64_TLSLD_MOVW_DTPREL_G1
75// CHECK-ELF-NAMES: 20 R_AARCH64_TLSLD_MOVW_DTPREL_G1
76// CHECK-ELF-NAMES: 24 R_AARCH64_TLSLD_MOVW_DTPREL_G1
77// CHECK-ELF-NAMES: 28 R_AARCH64_TLSLD_MOVW_DTPREL_G1
78
79        movk x9, #:dtprel_g1_nc:var
80        movk w10, #:dtprel_g1_nc:var
81// CHECK: movk    x9, #:dtprel_g1_nc:var  // encoding: [0x09'A',A,0xa0'A',0xf2'A']
82// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_g1_nc:var, kind: fixup_a64_movw_dtprel_g1_nc
83// CHECK-NEXT: movk    w10, #:dtprel_g1_nc:var // encoding: [0x0a'A',A,0xa0'A',0x72'A']
84// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_g1_nc:var, kind: fixup_a64_movw_dtprel_g1_nc
85
86// CHECK-ELF: # Relocation 8
87// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000020)
88// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
89// CHECK-ELF-NEXT:  ('r_type', 0x0000020d)
90// CHECK-ELF: # Relocation 9
91// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000024)
92// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
93// CHECK-ELF-NEXT:  ('r_type', 0x0000020d)
94
95// CHECK-ELF-NAMES: 32 R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC
96// CHECK-ELF-NAMES: 36 R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC
97
98        movz x11, #:dtprel_g0:var
99        movn x12, #:dtprel_g0:var
100        movz w13, #:dtprel_g0:var
101        movn w14, #:dtprel_g0:var
102// CHECK: movz    x11, #:dtprel_g0:var    // encoding: [0x0b'A',A,0x80'A',0x92'A']
103// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_g0:var, kind: fixup_a64_movw_dtprel_g0
104// CHECK-NEXT: movn    x12, #:dtprel_g0:var    // encoding: [0x0c'A',A,0x80'A',0x92'A']
105// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_g0:var, kind: fixup_a64_movw_dtprel_g0
106// CHECK-NEXT: movz    w13, #:dtprel_g0:var    // encoding: [0x0d'A',A,0x80'A',0x12'A']
107// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_g0:var, kind: fixup_a64_movw_dtprel_g0
108// CHECK-NEXT: movn    w14, #:dtprel_g0:var    // encoding: [0x0e'A',A,0x80'A',0x12'A']
109
110
111// CHECK-ELF: # Relocation 10
112// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000028)
113// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
114// CHECK-ELF-NEXT:  ('r_type', 0x0000020e)
115// CHECK-ELF: # Relocation 11
116// CHECK-ELF-NEXT: (('r_offset', 0x000000000000002c)
117// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
118// CHECK-ELF-NEXT:  ('r_type', 0x0000020e)
119// CHECK-ELF: # Relocation 12
120// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000030)
121// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
122// CHECK-ELF-NEXT:  ('r_type', 0x0000020e)
123// CHECK-ELF: # Relocation 13
124// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000034)
125// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
126// CHECK-ELF-NEXT:  ('r_type', 0x0000020e)
127
128// CHECK-ELF-NAMES: 40 R_AARCH64_TLSLD_MOVW_DTPREL_G0
129// CHECK-ELF-NAMES: 44 R_AARCH64_TLSLD_MOVW_DTPREL_G0
130// CHECK-ELF-NAMES: 48 R_AARCH64_TLSLD_MOVW_DTPREL_G0
131// CHECK-ELF-NAMES: 52 R_AARCH64_TLSLD_MOVW_DTPREL_G0
132
133
134        movk x15, #:dtprel_g0_nc:var
135        movk w16, #:dtprel_g0_nc:var
136// CHECK: movk    x15, #:dtprel_g0_nc:var // encoding: [0x0f'A',A,0x80'A',0xf2'A']
137// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_g0_nc:var, kind: fixup_a64_movw_dtprel_g0_nc
138// CHECK-NEXT: movk    w16, #:dtprel_g0_nc:var // encoding: [0x10'A',A,0x80'A',0x72'A']
139// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_g0_nc:var, kind: fixup_a64_movw_dtprel_g0_nc
140
141// CHECK-ELF: # Relocation 14
142// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000038)
143// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
144// CHECK-ELF-NEXT:  ('r_type', 0x0000020f)
145// CHECK-ELF: # Relocation 15
146// CHECK-ELF-NEXT: (('r_offset', 0x000000000000003c)
147// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
148// CHECK-ELF-NEXT:  ('r_type', 0x0000020f)
149
150// CHECK-ELF-NAMES: 56 R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC
151// CHECK-ELF-NAMES: 60 R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC
152
153        add x17, x18, #:dtprel_hi12:var, lsl #12
154        add w19, w20, #:dtprel_hi12:var, lsl #12
155// CHECK: add     x17, x18, #:dtprel_hi12:var, lsl #12 // encoding: [0x51'A',0x02'A',0x40'A',0x91'A']
156// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_hi12:var, kind: fixup_a64_add_dtprel_hi12
157// CHECK-NEXT: add     w19, w20, #:dtprel_hi12:var, lsl #12 // encoding: [0x93'A',0x02'A',0x40'A',0x11'A']
158// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_hi12:var, kind: fixup_a64_add_dtprel_hi12
159
160// CHECK-ELF: # Relocation 16
161// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000040)
162// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
163// CHECK-ELF-NEXT:  ('r_type', 0x00000210)
164// CHECK-ELF: # Relocation 17
165// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000044)
166// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
167// CHECK-ELF-NEXT:  ('r_type', 0x00000210)
168
169// CHECK-ELF-NAMES: 64 R_AARCH64_TLSLD_ADD_DTPREL_HI12
170// CHECK-ELF-NAMES: 68 R_AARCH64_TLSLD_ADD_DTPREL_HI12
171
172
173        add x21, x22, #:dtprel_lo12:var
174        add w23, w24, #:dtprel_lo12:var
175// CHECK: add     x21, x22, #:dtprel_lo12:var // encoding: [0xd5'A',0x02'A',A,0x91'A']
176// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_lo12:var, kind: fixup_a64_add_dtprel_lo12
177// CHECK-NEXT: add     w23, w24, #:dtprel_lo12:var // encoding: [0x17'A',0x03'A',A,0x11'A']
178// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_lo12:var, kind: fixup_a64_add_dtprel_lo12
179
180// CHECK-ELF: # Relocation 18
181// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000048)
182// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
183// CHECK-ELF-NEXT:  ('r_type', 0x00000211)
184// CHECK-ELF: # Relocation 19
185// CHECK-ELF-NEXT: (('r_offset', 0x000000000000004c)
186// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
187// CHECK-ELF-NEXT:  ('r_type', 0x00000211)
188
189// CHECK-ELF-NAMES: 72 R_AARCH64_TLSLD_ADD_DTPREL_LO12
190// CHECK-ELF-NAMES: 76 R_AARCH64_TLSLD_ADD_DTPREL_LO12
191
192        add x25, x26, #:dtprel_lo12_nc:var
193        add w27, w28, #:dtprel_lo12_nc:var
194// CHECK: add     x25, x26, #:dtprel_lo12_nc:var // encoding: [0x59'A',0x03'A',A,0x91'A']
195// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_lo12_nc:var, kind: fixup_a64_add_dtprel_lo12_nc
196// CHECK-NEXT: add     w27, w28, #:dtprel_lo12_nc:var // encoding: [0x9b'A',0x03'A',A,0x11'A']
197// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_lo12_nc:var, kind: fixup_a64_add_dtprel_lo12_nc
198
199// CHECK-ELF: # Relocation 20
200// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000050)
201// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
202// CHECK-ELF-NEXT:  ('r_type', 0x00000212)
203// CHECK-ELF: # Relocation 21
204// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000054)
205// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
206// CHECK-ELF-NEXT:  ('r_type', 0x00000212)
207
208// CHECK-ELF-NAMES: 80 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC
209// CHECK-ELF-NAMES: 84 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC
210
211        ldrb w29, [x30, #:dtprel_lo12:var]
212        ldrsb x29, [x28, #:dtprel_lo12_nc:var]
213// CHECK: ldrb    w29, [x30, #:dtprel_lo12:var] // encoding: [0xdd'A',0x03'A',0x40'A',0x39'A']
214// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_lo12:var, kind: fixup_a64_ldst8_dtprel_lo12
215// CHECK-NEXT: ldrsb   x29, [x28, #:dtprel_lo12_nc:var] // encoding: [0x9d'A',0x03'A',0x80'A',0x39'A']
216// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_lo12_nc:var, kind: fixup_a64_ldst8_dtprel_lo12_nc
217
218// CHECK-ELF: # Relocation 22
219// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000058)
220// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
221// CHECK-ELF-NEXT:  ('r_type', 0x00000213)
222// CHECK-ELF: # Relocation 23
223// CHECK-ELF-NEXT: (('r_offset', 0x000000000000005c)
224// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
225// CHECK-ELF-NEXT:  ('r_type', 0x00000214)
226
227// CHECK-ELF-NAMES: 88 R_AARCH64_TLSLD_LDST8_DTPREL_LO12
228// CHECK-ELF-NAMES: 92 R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC
229
230        strh w27, [x26, #:dtprel_lo12:var]
231        ldrsh x25, [x24, #:dtprel_lo12_nc:var]
232// CHECK: strh    w27, [x26, #:dtprel_lo12:var] // encoding: [0x5b'A',0x03'A',A,0x79'A']
233// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_lo12:var, kind: fixup_a64_ldst16_dtprel_lo12
234// CHECK-NEXT: ldrsh   x25, [x24, #:dtprel_lo12_nc:var] // encoding: [0x19'A',0x03'A',0x80'A',0x79'A']
235// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_lo12_nc:var, kind: fixup_a64_ldst16_dtprel_lo12_n
236
237// CHECK-ELF: # Relocation 24
238// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000060)
239// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
240// CHECK-ELF-NEXT:  ('r_type', 0x00000215)
241// CHECK-ELF: # Relocation 25
242// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000064)
243// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
244// CHECK-ELF-NEXT:  ('r_type', 0x00000216)
245
246// CHECK-ELF-NAMES: 96 R_AARCH64_TLSLD_LDST16_DTPREL_LO12
247// CHECK-ELF-NAMES: 100 R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC
248
249        ldr w23, [x22, #:dtprel_lo12:var]
250        ldrsw x21, [x20, #:dtprel_lo12_nc:var]
251// CHECK: ldr     w23, [x22, #:dtprel_lo12:var] // encoding: [0xd7'A',0x02'A',0x40'A',0xb9'A']
252// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_lo12:var, kind: fixup_a64_ldst32_dtprel_lo12
253// CHECK-NEXT: ldrsw   x21, [x20, #:dtprel_lo12_nc:var] // encoding: [0x95'A',0x02'A',0x80'A',0xb9'A']
254// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_lo12_nc:var, kind: fixup_a64_ldst32_dtprel_lo12_n
255
256// CHECK-ELF: # Relocation 26
257// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000068)
258// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
259// CHECK-ELF-NEXT:  ('r_type', 0x00000217)
260// CHECK-ELF: # Relocation 27
261// CHECK-ELF-NEXT: (('r_offset', 0x000000000000006c)
262// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
263// CHECK-ELF-NEXT:  ('r_type', 0x00000218)
264
265// CHECK-ELF-NAMES: 104 R_AARCH64_TLSLD_LDST32_DTPREL_LO12
266// CHECK-ELF-NAMES: 108 R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC
267
268        ldr x19, [x18, #:dtprel_lo12:var]
269        str x17, [x16, #:dtprel_lo12_nc:var]
270// CHECK: ldr     x19, [x18, #:dtprel_lo12:var] // encoding: [0x53'A',0x02'A',0x40'A',0xf9'A']
271// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_lo12:var, kind: fixup_a64_ldst64_dtprel_lo12
272// CHECK-NEXT: str     x17, [x16, #:dtprel_lo12_nc:var] // encoding: [0x11'A',0x02'A',A,0xf9'A']
273// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :dtprel_lo12_nc:var, kind: fixup_a64_ldst64_dtprel_lo12_nc
274
275
276// CHECK-ELF: # Relocation 28
277// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000070)
278// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
279// CHECK-ELF-NEXT:  ('r_type', 0x00000219)
280// CHECK-ELF: # Relocation 29
281// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000074)
282// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
283// CHECK-ELF-NEXT:  ('r_type', 0x0000021a)
284
285// CHECK-ELF-NAMES: 112 R_AARCH64_TLSLD_LDST64_DTPREL_LO12
286// CHECK-ELF-NAMES: 116 R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC
287
288        // TLS initial-exec forms
289        movz x15, #:gottprel_g1:var
290        movz w14, #:gottprel_g1:var
291// CHECK: movz    x15, #:gottprel_g1:var  // encoding: [0x0f'A',A,0xa0'A',0x92'A']
292// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :gottprel_g1:var, kind: fixup_a64_movw_gottprel_g1
293// CHECK-NEXT: movz    w14, #:gottprel_g1:var  // encoding: [0x0e'A',A,0xa0'A',0x12'A']
294// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :gottprel_g1:var, kind: fixup_a64_movw_gottprel_g1
295
296// CHECK-ELF: # Relocation 30
297// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000078)
298// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
299// CHECK-ELF-NEXT:  ('r_type', 0x0000021b)
300// CHECK-ELF: # Relocation 31
301// CHECK-ELF-NEXT: (('r_offset', 0x000000000000007c)
302// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
303// CHECK-ELF-NEXT:  ('r_type', 0x0000021b)
304
305// CHECK-ELF-NAMES: 120 R_AARCH64_TLSIE_MOVW_GOTTPREL_G1
306// CHECK-ELF-NAMES: 124 R_AARCH64_TLSIE_MOVW_GOTTPREL_G1
307
308        movk x13, #:gottprel_g0_nc:var
309        movk w12, #:gottprel_g0_nc:var
310// CHECK: movk    x13, #:gottprel_g0_nc:var // encoding: [0x0d'A',A,0x80'A',0xf2'A']
311// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :gottprel_g0_nc:var, kind: fixup_a64_movw_gottprel_g0_nc
312// CHECK-NEXT: movk    w12, #:gottprel_g0_nc:var // encoding: [0x0c'A',A,0x80'A',0x72'A']
313// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :gottprel_g0_nc:var, kind: fixup_a64_movw_gottprel_g0_nc
314
315// CHECK-ELF: # Relocation 32
316// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000080)
317// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
318// CHECK-ELF-NEXT:  ('r_type', 0x0000021c)
319// CHECK-ELF: # Relocation 33
320// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000084)
321// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
322// CHECK-ELF-NEXT:  ('r_type', 0x0000021c)
323
324// CHECK-ELF-NAMES: 128 R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC
325// CHECK-ELF-NAMES: 132 R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC
326
327        adrp x11, :gottprel:var
328        ldr x10, [x0, #:gottprel_lo12:var]
329        ldr x9, :gottprel:var
330// CHECK: adrp    x11, :gottprel:var      // encoding: [0x0b'A',A,A,0x90'A']
331// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :gottprel:var, kind: fixup_a64_adr_gottprel_page
332// CHECK-NEXT: ldr     x10, [x0, #:gottprel_lo12:var] // encoding: [0x0a'A',A,0x40'A',0xf9'A']
333// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :gottprel_lo12:var, kind: fixup_a64_ld64_gottprel_lo12_nc
334// CHECK-NEXT: ldr     x9, :gottprel:var       // encoding: [0x09'A',A,A,0x58'A']
335// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :gottprel:var, kind: fixup_a64_ld_gottprel_prel19
336
337// CHECK-ELF: # Relocation 34
338// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000088)
339// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
340// CHECK-ELF-NEXT:  ('r_type', 0x0000021d)
341// CHECK-ELF: # Relocation 35
342// CHECK-ELF-NEXT: (('r_offset', 0x000000000000008c)
343// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
344// CHECK-ELF-NEXT:  ('r_type', 0x0000021e)
345// CHECK-ELF: # Relocation 36
346// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000090)
347// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
348// CHECK-ELF-NEXT:  ('r_type', 0x0000021f)
349
350// CHECK-ELF-NAMES: 136 R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE
351// CHECK-ELF-NAMES: 140 R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC
352// CHECK-ELF-NAMES: 144 R_AARCH64_TLSIE_LD_GOTTPREL_PREL19
353
354        // TLS local-exec forms
355        movz x3, #:tprel_g2:var
356        movn x4, #:tprel_g2:var
357// CHECK: movz    x3, #:tprel_g2:var      // encoding: [0x03'A',A,0xc0'A',0x92'A']
358// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_g2:var, kind: fixup_a64_movw_tprel_g2
359// CHECK-NEXT: movn    x4, #:tprel_g2:var      // encoding: [0x04'A',A,0xc0'A',0x92'A']
360// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_g2:var, kind: fixup_a64_movw_tprel_g2
361
362// CHECK-ELF: # Relocation 37
363// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000094)
364// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
365// CHECK-ELF-NEXT:  ('r_type', 0x00000220)
366// CHECK-ELF: # Relocation 38
367// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000098)
368// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
369// CHECK-ELF-NEXT:  ('r_type', 0x00000220)
370
371// CHECK-ELF-NAMES: 148 R_AARCH64_TLSLE_MOVW_TPREL_G2
372// CHECK-ELF-NAMES: 152 R_AARCH64_TLSLE_MOVW_TPREL_G2
373
374        movz x5, #:tprel_g1:var
375        movn x6, #:tprel_g1:var
376        movz w7, #:tprel_g1:var
377        movn w8, #:tprel_g1:var
378// CHECK: movz    x5, #:tprel_g1:var      // encoding: [0x05'A',A,0xa0'A',0x92'A']
379// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_g1:var, kind: fixup_a64_movw_tprel_g1
380// CHECK-NEXT: movn    x6, #:tprel_g1:var      // encoding: [0x06'A',A,0xa0'A',0x92'A']
381// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_g1:var, kind: fixup_a64_movw_tprel_g1
382// CHECK-NEXT: movz    w7, #:tprel_g1:var      // encoding: [0x07'A',A,0xa0'A',0x12'A']
383// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_g1:var, kind: fixup_a64_movw_tprel_g1
384// CHECK-NEXT: movn    w8, #:tprel_g1:var      // encoding: [0x08'A',A,0xa0'A',0x12'A']
385// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_g1:var, kind: fixup_a64_movw_tprel_g1
386
387// CHECK-ELF: # Relocation 39
388// CHECK-ELF-NEXT: (('r_offset', 0x000000000000009c)
389// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
390// CHECK-ELF-NEXT:  ('r_type', 0x00000221)
391// CHECK-ELF: # Relocation 40
392// CHECK-ELF-NEXT: (('r_offset', 0x00000000000000a0)
393// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
394// CHECK-ELF-NEXT:  ('r_type', 0x00000221)
395// CHECK-ELF: # Relocation 41
396// CHECK-ELF-NEXT: (('r_offset', 0x00000000000000a4)
397// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
398// CHECK-ELF-NEXT:  ('r_type', 0x00000221)
399// CHECK-ELF: # Relocation 42
400// CHECK-ELF-NEXT: (('r_offset', 0x00000000000000a8)
401// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
402// CHECK-ELF-NEXT:  ('r_type', 0x00000221)
403
404// CHECK-ELF-NAMES: 156 R_AARCH64_TLSLE_MOVW_TPREL_G1
405// CHECK-ELF-NAMES: 160 R_AARCH64_TLSLE_MOVW_TPREL_G1
406// CHECK-ELF-NAMES: 164 R_AARCH64_TLSLE_MOVW_TPREL_G1
407// CHECK-ELF-NAMES: 168 R_AARCH64_TLSLE_MOVW_TPREL_G1
408
409        movk x9, #:tprel_g1_nc:var
410        movk w10, #:tprel_g1_nc:var
411// CHECK: movk    x9, #:tprel_g1_nc:var   // encoding: [0x09'A',A,0xa0'A',0xf2'A']
412// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_g1_nc:var, kind: fixup_a64_movw_tprel_g1_nc
413// CHECK-NEXT: movk    w10, #:tprel_g1_nc:var  // encoding: [0x0a'A',A,0xa0'A',0x72'A']
414// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_g1_nc:var, kind: fixup_a64_movw_tprel_g1_nc
415
416// CHECK-ELF: # Relocation 43
417// CHECK-ELF-NEXT: (('r_offset', 0x00000000000000ac)
418// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
419// CHECK-ELF-NEXT:  ('r_type', 0x00000222)
420// CHECK-ELF: # Relocation 44
421// CHECK-ELF-NEXT: (('r_offset', 0x00000000000000b0)
422// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
423// CHECK-ELF-NEXT:  ('r_type', 0x00000222)
424
425// CHECK-ELF-NAMES: 172 R_AARCH64_TLSLE_MOVW_TPREL_G1_NC
426// CHECK-ELF-NAMES: 176 R_AARCH64_TLSLE_MOVW_TPREL_G1_NC
427
428        movz x11, #:tprel_g0:var
429        movn x12, #:tprel_g0:var
430        movz w13, #:tprel_g0:var
431        movn w14, #:tprel_g0:var
432// CHECK: movz    x11, #:tprel_g0:var     // encoding: [0x0b'A',A,0x80'A',0x92'A']
433// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_g0:var, kind: fixup_a64_movw_tprel_g0
434// CHECK-NEXT: movn    x12, #:tprel_g0:var     // encoding: [0x0c'A',A,0x80'A',0x92'A']
435// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_g0:var, kind: fixup_a64_movw_tprel_g0
436// CHECK-NEXT: movz    w13, #:tprel_g0:var     // encoding: [0x0d'A',A,0x80'A',0x12'A']
437// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_g0:var, kind: fixup_a64_movw_tprel_g0
438// CHECK-NEXT: movn    w14, #:tprel_g0:var     // encoding: [0x0e'A',A,0x80'A',0x12'A']
439// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_g0:var, kind: fixup_a64_movw_tprel_g0
440
441// CHECK-ELF: # Relocation 45
442// CHECK-ELF-NEXT: (('r_offset', 0x00000000000000b4)
443// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
444// CHECK-ELF-NEXT:  ('r_type', 0x00000223)
445// CHECK-ELF: # Relocation 46
446// CHECK-ELF-NEXT: (('r_offset', 0x00000000000000b8)
447// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
448// CHECK-ELF-NEXT:  ('r_type', 0x00000223)
449// CHECK-ELF: # Relocation 47
450// CHECK-ELF-NEXT: (('r_offset', 0x00000000000000bc)
451// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
452// CHECK-ELF-NEXT:  ('r_type', 0x00000223)
453// CHECK-ELF: # Relocation 48
454// CHECK-ELF-NEXT: (('r_offset', 0x00000000000000c0)
455// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
456// CHECK-ELF-NEXT:  ('r_type', 0x00000223)
457
458// CHECK-ELF-NAMES: 180 R_AARCH64_TLSLE_MOVW_TPREL_G0
459// CHECK-ELF-NAMES: 184 R_AARCH64_TLSLE_MOVW_TPREL_G0
460// CHECK-ELF-NAMES: 188 R_AARCH64_TLSLE_MOVW_TPREL_G0
461// CHECK-ELF-NAMES: 192 R_AARCH64_TLSLE_MOVW_TPREL_G0
462
463        movk x15, #:tprel_g0_nc:var
464        movk w16, #:tprel_g0_nc:var
465// CHECK: movk    x15, #:tprel_g0_nc:var  // encoding: [0x0f'A',A,0x80'A',0xf2'A']
466// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_g0_nc:var, kind: fixup_a64_movw_tprel_g0_nc
467// CHECK-NEXT: movk    w16, #:tprel_g0_nc:var  // encoding: [0x10'A',A,0x80'A',0x72'A']
468// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_g0_nc:var, kind: fixup_a64_movw_tprel_g0_nc
469
470// CHECK-ELF: # Relocation 49
471// CHECK-ELF-NEXT: (('r_offset', 0x00000000000000c4)
472// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
473// CHECK-ELF-NEXT:  ('r_type', 0x00000224)
474// CHECK-ELF: # Relocation 50
475// CHECK-ELF-NEXT: (('r_offset', 0x00000000000000c8)
476// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
477// CHECK-ELF-NEXT:  ('r_type', 0x00000224)
478
479// CHECK-ELF-NAMES: 196 R_AARCH64_TLSLE_MOVW_TPREL_G0_NC
480// CHECK-ELF-NAMES: 200 R_AARCH64_TLSLE_MOVW_TPREL_G0_NC
481
482        add x17, x18, #:tprel_hi12:var, lsl #12
483        add w19, w20, #:tprel_hi12:var, lsl #12
484// CHECK: add     x17, x18, #:tprel_hi12:var, lsl #12 // encoding: [0x51'A',0x02'A',0x40'A',0x91'A']
485// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_hi12:var, kind: fixup_a64_add_tprel_hi12
486// CHECK-NEXT: add     w19, w20, #:tprel_hi12:var, lsl #12 // encoding: [0x93'A',0x02'A',0x40'A',0x11'A']
487// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_hi12:var, kind: fixup_a64_add_tprel_hi12
488
489// CHECK-ELF: # Relocation 51
490// CHECK-ELF-NEXT: (('r_offset', 0x00000000000000cc)
491// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
492// CHECK-ELF-NEXT:  ('r_type', 0x00000225)
493// CHECK-ELF: # Relocation 52
494// CHECK-ELF-NEXT: (('r_offset', 0x00000000000000d0)
495// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
496// CHECK-ELF-NEXT:  ('r_type', 0x00000225)
497
498// CHECK-ELF-NAMES: 204 R_AARCH64_TLSLE_ADD_TPREL_HI12
499// CHECK-ELF-NAMES: 208 R_AARCH64_TLSLE_ADD_TPREL_HI12
500
501        add x21, x22, #:tprel_lo12:var
502        add w23, w24, #:tprel_lo12:var
503// CHECK: add     x21, x22, #:tprel_lo12:var // encoding: [0xd5'A',0x02'A',A,0x91'A']
504// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_lo12:var, kind: fixup_a64_add_tprel_lo12
505// CHECK-NEXT: add     w23, w24, #:tprel_lo12:var // encoding: [0x17'A',0x03'A',A,0x11'A']
506// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_lo12:var, kind: fixup_a64_add_tprel_lo12
507
508// CHECK-ELF: # Relocation 53
509// CHECK-ELF-NEXT: (('r_offset', 0x00000000000000d4)
510// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
511// CHECK-ELF-NEXT:  ('r_type', 0x00000226)
512// CHECK-ELF: # Relocation 54
513// CHECK-ELF-NEXT: (('r_offset', 0x00000000000000d8)
514// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
515// CHECK-ELF-NEXT:  ('r_type', 0x00000226)
516
517// CHECK-ELF-NAMES: 212 R_AARCH64_TLSLE_ADD_TPREL_LO12
518// CHECK-ELF-NAMES: 216 R_AARCH64_TLSLE_ADD_TPREL_LO12
519
520        add x25, x26, #:tprel_lo12_nc:var
521        add w27, w28, #:tprel_lo12_nc:var
522// CHECK: add     x25, x26, #:tprel_lo12_nc:var // encoding: [0x59'A',0x03'A',A,0x91'A']
523// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_lo12_nc:var, kind: fixup_a64_add_tprel_lo12_nc
524// CHECK-NEXT: add     w27, w28, #:tprel_lo12_nc:var // encoding: [0x9b'A',0x03'A',A,0x11'A']
525// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_lo12_nc:var, kind: fixup_a64_add_tprel_lo12_nc
526
527// CHECK-ELF: # Relocation 55
528// CHECK-ELF-NEXT: (('r_offset', 0x00000000000000dc)
529// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
530// CHECK-ELF-NEXT:  ('r_type', 0x00000227)
531// CHECK-ELF: # Relocation 56
532// CHECK-ELF-NEXT: (('r_offset', 0x00000000000000e0)
533// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
534// CHECK-ELF-NEXT:  ('r_type', 0x00000227)
535
536
537// CHECK-ELF-NAMES: 220 R_AARCH64_TLSLE_ADD_TPREL_LO12_NC
538// CHECK-ELF-NAMES: 224 R_AARCH64_TLSLE_ADD_TPREL_LO12_NC
539
540        ldrb w29, [x30, #:tprel_lo12:var]
541        ldrsb x29, [x28, #:tprel_lo12_nc:var]
542// CHECK: ldrb    w29, [x30, #:tprel_lo12:var] // encoding: [0xdd'A',0x03'A',0x40'A',0x39'A']
543// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_lo12:var, kind: fixup_a64_ldst8_tprel_lo12
544// CHECK-NEXT: ldrsb   x29, [x28, #:tprel_lo12_nc:var] // encoding: [0x9d'A',0x03'A',0x80'A',0x39'A']
545// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_lo12_nc:var, kind: fixup_a64_ldst8_tprel_lo12_nc
546
547// CHECK-ELF: # Relocation 57
548// CHECK-ELF-NEXT: (('r_offset', 0x00000000000000e4)
549// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
550// CHECK-ELF-NEXT:  ('r_type', 0x00000228)
551// CHECK-ELF: # Relocation 58
552// CHECK-ELF-NEXT: (('r_offset', 0x00000000000000e8)
553// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
554// CHECK-ELF-NEXT:  ('r_type', 0x00000229)
555
556// CHECK-ELF-NAMES: 228 R_AARCH64_TLSLE_LDST8_TPREL_LO12
557// CHECK-ELF-NAMES: 232 R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC
558
559        strh w27, [x26, #:tprel_lo12:var]
560        ldrsh x25, [x24, #:tprel_lo12_nc:var]
561// CHECK: strh    w27, [x26, #:tprel_lo12:var] // encoding: [0x5b'A',0x03'A',A,0x79'A']
562// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_lo12:var, kind: fixup_a64_ldst16_tprel_lo12
563// CHECK-NEXT: ldrsh   x25, [x24, #:tprel_lo12_nc:var] // encoding: [0x19'A',0x03'A',0x80'A',0x79'A']
564// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_lo12_nc:var, kind: fixup_a64_ldst16_tprel_lo12_n
565
566// CHECK-ELF: # Relocation 59
567// CHECK-ELF-NEXT: (('r_offset', 0x00000000000000ec)
568// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
569// CHECK-ELF-NEXT:  ('r_type', 0x0000022a)
570// CHECK-ELF: # Relocation 60
571// CHECK-ELF-NEXT: (('r_offset', 0x00000000000000f0)
572// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
573// CHECK-ELF-NEXT:  ('r_type', 0x0000022b)
574
575// CHECK-ELF-NAMES: 236 R_AARCH64_TLSLE_LDST16_TPREL_LO12
576// CHECK-ELF-NAMES: 240 R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC
577
578        ldr w23, [x22, #:tprel_lo12:var]
579        ldrsw x21, [x20, #:tprel_lo12_nc:var]
580// CHECK: ldr     w23, [x22, #:tprel_lo12:var] // encoding: [0xd7'A',0x02'A',0x40'A',0xb9'A']
581// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_lo12:var, kind: fixup_a64_ldst32_tprel_lo12
582// CHECK-NEXT: ldrsw   x21, [x20, #:tprel_lo12_nc:var] // encoding: [0x95'A',0x02'A',0x80'A',0xb9'A']
583// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_lo12_nc:var, kind: fixup_a64_ldst32_tprel_lo12_n
584
585// CHECK-ELF: # Relocation 61
586// CHECK-ELF-NEXT: (('r_offset', 0x00000000000000f4)
587// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
588// CHECK-ELF-NEXT:  ('r_type', 0x0000022c)
589// CHECK-ELF: # Relocation 62
590// CHECK-ELF-NEXT: (('r_offset', 0x00000000000000f8)
591// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
592// CHECK-ELF-NEXT:  ('r_type', 0x0000022d)
593
594// CHECK-ELF-NAMES: 244 R_AARCH64_TLSLE_LDST32_TPREL_LO12
595// CHECK-ELF-NAMES: 248 R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC
596
597        ldr x19, [x18, #:tprel_lo12:var]
598        str x17, [x16, #:tprel_lo12_nc:var]
599// CHECK: ldr     x19, [x18, #:tprel_lo12:var] // encoding: [0x53'A',0x02'A',0x40'A',0xf9'A']
600// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_lo12:var, kind: fixup_a64_ldst64_tprel_lo12
601// CHECK-NEXT: str     x17, [x16, #:tprel_lo12_nc:var] // encoding: [0x11'A',0x02'A',A,0xf9'A']
602// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tprel_lo12_nc:var, kind: fixup_a64_ldst64_tprel_lo12_nc
603
604// CHECK-ELF: # Relocation 63
605// CHECK-ELF-NEXT: (('r_offset', 0x00000000000000fc)
606// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
607// CHECK-ELF-NEXT:  ('r_type', 0x0000022e)
608// CHECK-ELF: # Relocation 64
609// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000100)
610// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
611// CHECK-ELF-NEXT:  ('r_type', 0x0000022f)
612
613// CHECK-ELF-NAMES: 252 R_AARCH64_TLSLE_LDST64_TPREL_LO12
614// CHECK-ELF-NAMES: 256 R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC
615
616        // TLS descriptor forms
617        adrp x8, :tlsdesc:var
618        ldr x7, [x6, :tlsdesc_lo12:var]
619        add x5, x4, #:tlsdesc_lo12:var
620        .tlsdesccall var
621        blr x3
622
623// CHECK: adrp    x8, :tlsdesc:var        // encoding: [0x08'A',A,A,0x90'A']
624// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tlsdesc:var, kind: fixup_a64_tlsdesc_adr_page
625// CHECK-NEXT: ldr     x7, [x6, #:tlsdesc_lo12:var] // encoding: [0xc7'A',A,0x40'A',0xf9'A']
626// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tlsdesc_lo12:var, kind: fixup_a64_tlsdesc_ld64_lo12_nc
627// CHECK-NEXT: add     x5, x4, #:tlsdesc_lo12:var // encoding: [0x85'A',A,A,0x91'A']
628// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tlsdesc_lo12:var, kind: fixup_a64_tlsdesc_add_lo12_nc
629// CHECK-NEXT: .tlsdesccall var                // encoding: []
630// CHECK-NEXT:                                 //   fixup A - offset: 0, value: :tlsdesc:var, kind: fixup_a64_tlsdesc_call
631// CHECK: blr     x3                      // encoding: [0x60,0x00,0x3f,0xd6]
632
633
634// CHECK-ELF: # Relocation 65
635// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000104)
636// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
637// CHECK-ELF-NEXT:  ('r_type', 0x00000232)
638// CHECK-ELF: # Relocation 66
639// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000108)
640// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
641// CHECK-ELF-NEXT:  ('r_type', 0x00000233)
642// CHECK-ELF: # Relocation 67
643// CHECK-ELF-NEXT: (('r_offset', 0x000000000000010c)
644// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
645// CHECK-ELF-NEXT:  ('r_type', 0x00000234)
646// CHECK-ELF: # Relocation 68
647// CHECK-ELF-NEXT: (('r_offset', 0x0000000000000110)
648// CHECK-ELF-NEXT:  ('r_sym', [[VARSYM]])
649// CHECK-ELF-NEXT:  ('r_type', 0x00000239)
650
651// CHECK-ELF-NAMES: 260 R_AARCH64_TLSDESC_ADR_PAGE
652// CHECK-ELF-NAMES: 264 R_AARCH64_TLSDESC_LD64_LO12_NC
653// CHECK-ELF-NAMES: 268 R_AARCH64_TLSDESC_ADD_LO12_NC
654// CHECK-ELF-NAMES: 272 R_AARCH64_TLSDESC_CALL
655
656
657// Make sure symbol 5 has type STT_TLS:
658
659// CHECK-ELF: # Symbol 5
660// CHECK-ELF-NEXT: (('st_name', 0x00000006) # 'var'
661// CHECK-ELF-NEXT:  ('st_bind', 0x1)
662// CHECK-ELF-NEXT:  ('st_type', 0x6)
663