[DAGCombiner] Add target hook function to decide folding (mul (add x, c1), c2)
[llvm-project.git] / llvm / test / MC / Mips / expansion-jal-sym-pic.s
blobb8429e108ab8a8856f18b474055dcfe3cf673631
1 # RUN: llvm-mc %s -triple mips-unknown-linux-gnu -show-encoding |\
2 # RUN: FileCheck %s -check-prefixes=ALL,MIPS,O32
4 # RUN: llvm-mc %s -triple mips-unknown-linux-gnu -mattr=+xgot -show-encoding |\
5 # RUN: FileCheck %s -check-prefixes=ALL,MIPS,XO32
7 # RUN: llvm-mc %s -triple mips64-unknown-linux-gnuabin32 -show-encoding |\
8 # RUN: FileCheck %s -check-prefixes=ALL,MIPS,N32
10 # RUN: llvm-mc %s -triple mips64-unknown-linux-gnuabin32 -mattr=+xgot -show-encoding |\
11 # RUN: FileCheck %s -check-prefixes=ALL,MIPS,XN32
13 # RUN: llvm-mc %s -triple mips64-unknown-linux-gnu -show-encoding |\
14 # RUN: FileCheck %s -check-prefixes=ALL,MIPS,N64
16 # RUN: llvm-mc %s -triple mips64-unknown-linux-gnu -mattr=+xgot -show-encoding |\
17 # RUN: FileCheck %s -check-prefixes=ALL,MIPS,XN64
19 # RUN: llvm-mc %s -triple mips-unknown-linux-gnu -mattr=micromips -show-encoding |\
20 # RUN: FileCheck %s -check-prefixes=ALL,MM,O32-MM
22 # Repeat the tests but using ELF output. An initial version of this patch did
23 # this as the output different depending on whether it went through
24 # MCAsmStreamer or MCELFStreamer. This ensures that the assembly expansion and
25 # direct objection emission match.
27 # RUN: llvm-mc %s -triple mips-unknown-linux-gnu -filetype=obj | \
28 # RUN: llvm-objdump -d -r - | FileCheck %s --check-prefixes=ELF-O32
29 # RUN: llvm-mc %s -triple mips-unknown-linux-gnu -mattr=+xgot -filetype=obj | \
30 # RUN: llvm-objdump -d -r - | FileCheck %s --check-prefixes=ELF-XO32
31 # RUN: llvm-mc %s -triple mips64-unknown-linux-gnuabin32 -filetype=obj | \
32 # RUN: llvm-objdump -d -r - | FileCheck %s --check-prefixes=ELF-N32
33 # RUN: llvm-mc %s -triple mips64-unknown-linux-gnuabin32 -mattr=+xgot -filetype=obj | \
34 # RUN: llvm-objdump -d -r - | FileCheck %s --check-prefixes=ELF-XN32
35 # RUN: llvm-mc %s -triple mips64-unknown-linux-gnu -filetype=obj | \
36 # RUN: llvm-objdump -d -r - | FileCheck %s --check-prefixes=ELF-N64
37 # RUN: llvm-mc %s -triple mips64-unknown-linux-gnu -mattr=+xgot -filetype=obj | \
38 # RUN: llvm-objdump -d -r - | FileCheck %s --check-prefixes=ELF-XN64
40 .weak weak_label
42 .text
43 .option pic2
45 .ent local_label
46 local_label:
47 .frame $sp, 0, $ra
48 .set noreorder
50 jal local_label
51 nop
53 # Expanding "jal local_label":
54 # O32: lw $25, %got(local_label)($gp) # encoding: [0x8f,0x99,A,A]
55 # O32: # fixup A - offset: 0, value: %got(local_label), kind: fixup_Mips_GOT
56 # O32: addiu $25, $25, %lo(local_label) # encoding: [0x27,0x39,A,A]
57 # O32: # fixup A - offset: 0, value: %lo(local_label), kind: fixup_Mips_LO16
58 # O32-NEXT: .reloc ($tmp0), R_MIPS_JALR, local_label
60 # ELF-O32: 8f 99 00 00 lw $25, 0($gp)
61 # ELF-O32-NEXT: R_MIPS_GOT16 .text
62 # ELF-O32-NEXT: 27 39 00 00 addiu $25, $25, 0
63 # ELF-O32-NEXT: R_MIPS_LO16 .text
64 # ELF-O32-NEXT: 03 20 f8 09 jalr $25
65 # ELF-O32-NEXT: R_MIPS_JALR local_label
67 # XO32: lw $25, %got(local_label)($gp) # encoding: [0x8f,0x99,A,A]
68 # XO32-NEXT: # fixup A - offset: 0, value: %got(local_label), kind: fixup_Mips_GOT
69 # XO32-NEXT: addiu $25, $25, %lo(local_label) # encoding: [0x27,0x39,A,A]
70 # XO32-NEXT: # fixup A - offset: 0, value: %lo(local_label), kind: fixup_Mips_LO16
71 # XO32-NEXT: .reloc ($tmp0), R_MIPS_JALR, local_label
73 # ELF-XO32: 8f 99 00 00 lw $25, 0($gp)
74 # ELF-XO32-NEXT: R_MIPS_GOT16 .text
75 # ELF-XO32-NEXT: 27 39 00 00 addiu $25, $25, 0
76 # ELF-XO32-NEXT: R_MIPS_LO16 .text
77 # ELF-XO32-NEXT: 03 20 f8 09 jalr $25
78 # ELF-XO32-NEXT: R_MIPS_JALR local_label
80 # N32: lw $25, %got_disp(local_label)($gp) # encoding: [0x8f,0x99,A,A]
81 # N32: # fixup A - offset: 0, value: %got_disp(local_label), kind: fixup_Mips_GOT_DISP
82 # N32-NEXT: .reloc .Ltmp0, R_MIPS_JALR, local_label
84 # ELF-N32: 8f 99 00 00 lw $25, 0($gp)
85 # ELF-N32-NEXT: R_MIPS_GOT_DISP local_label
86 # ELF-N32-NEXT: 03 20 f8 09 jalr $25
87 # ELF-N32-NEXT: R_MIPS_JALR local_label
89 # XN32: lw $25, %got_disp(local_label)($gp) # encoding: [0x8f,0x99,A,A]
90 # XN32-NEXT: # fixup A - offset: 0, value: %got_disp(local_label), kind: fixup_Mips_GOT_DISP
91 # XN32-NEXT: .reloc .Ltmp0, R_MIPS_JALR, local_label
93 # ELF-XN32: 8f 99 00 00 lw $25, 0($gp)
94 # ELF-XN32-NEXT: R_MIPS_GOT_DISP local_label
95 # ELF-XN32-NEXT: 03 20 f8 09 jalr $25
96 # ELF-XN32-NEXT: R_MIPS_JALR local_label
98 # N64: ld $25, %got_disp(local_label)($gp) # encoding: [0xdf,0x99,A,A]
99 # N64: # fixup A - offset: 0, value: %got_disp(local_label), kind: fixup_Mips_GOT_DISP
100 # N64-NEXT: .reloc .Ltmp0, R_MIPS_JALR, local_label
102 # ELF-N64: df 99 00 00 ld $25, 0($gp)
103 # ELF-N64-NEXT: R_MIPS_GOT_DISP/R_MIPS_NONE/R_MIPS_NONE local_label
104 # ELF-N64-NEXT: 03 20 f8 09 jalr $25
105 # ELF-N64-NEXT: R_MIPS_JALR/R_MIPS_NONE/R_MIPS_NONE local_label
107 # XN64: ld $25, %got_disp(local_label)($gp) # encoding: [0xdf,0x99,A,A]
108 # XN64-NEXT: # fixup A - offset: 0, value: %got_disp(local_label), kind: fixup_Mips_GOT_DISP
109 # XN64-NEXT: .reloc .Ltmp0, R_MIPS_JALR, local_label
111 # ELF-XN64: df 99 00 00 ld $25, 0($gp)
112 # ELF-XN64-NEXT: R_MIPS_GOT_DISP/R_MIPS_NONE/R_MIPS_NONE local_label
113 # ELF-XN64-NEXT: 03 20 f8 09 jalr $25
114 # ELF-XN64-NEXT: R_MIPS_JALR/R_MIPS_NONE/R_MIPS_NONE local_label
116 # O32-MM: lw $25, %got(local_label)($gp) # encoding: [0xff,0x3c,A,A]
117 # O32-MM: # fixup A - offset: 0, value: %got(local_label), kind: fixup_MICROMIPS_GOT16
118 # O32-MM: addiu $25, $25, %lo(local_label) # encoding: [0x33,0x39,A,A]
119 # O32-MM: # fixup A - offset: 0, value: %lo(local_label), kind: fixup_MICROMIPS_LO16
120 # O32-MM-NEXT: .reloc ($tmp0), R_MICROMIPS_JALR, local_label
122 # MIPS: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
123 # MM: jalr $ra, $25 # encoding: [0x03,0xf9,0x0f,0x3c]
124 # ALL: nop # encoding: [0x00,0x00,0x00,0x00]
126 jal local_label+8
129 # O32: lw $25, %got(local_label+8)($gp) # encoding: [0x8f,0x99,A,A]
130 # O32-NEXT: # fixup A - offset: 0, value: %got(local_label+8), kind: fixup_Mips_GOT
131 # O32-NEXT: addiu $25, $25, %lo(local_label+8) # encoding: [0x27,0x39,A,A]
132 # O32-NEXT: # fixup A - offset: 0, value: %lo(local_label+8), kind: fixup_Mips_LO16
133 # O32-NOT: .reloc
135 # ELF-O32: 8f 99 00 00 lw $25, 0($gp)
136 # ELF-O32-NEXT: R_MIPS_GOT16 .text
137 # ELF-O32-NEXT: 27 39 00 08 addiu $25, $25, 8
138 # ELF-O32-NEXT: R_MIPS_LO16 .text
139 # ELF-O32-NEXT: 03 20 f8 09 jalr $25
140 # ELF-O32-NEXT: 00 00 00 00 nop
142 # XO32: lw $25, %got(local_label+8)($gp) # encoding: [0x8f,0x99,A,A]
143 # XO32-NEXT: # fixup A - offset: 0, value: %got(local_label+8), kind: fixup_Mips_GOT
144 # XO32-NEXT: addiu $25, $25, %lo(local_label+8) # encoding: [0x27,0x39,A,A]
145 # XO32-NEXT: # fixup A - offset: 0, value: %lo(local_label+8), kind: fixup_Mips_LO16
146 # XO32-NOT: .reloc
148 # ELF-XO32: 8f 99 00 00 lw $25, 0($gp)
149 # ELF-XO32-NEXT: R_MIPS_GOT16 .text
150 # ELF-XO32-NEXT: 27 39 00 08 addiu $25, $25, 8
151 # ELF-XO32-NEXT: R_MIPS_LO16 .text
152 # ELF-XO32-NEXT: 03 20 f8 09 jalr $25
153 # ELF-XO32-NEXT: 00 00 00 00 nop
155 # N32: lw $25, %got_disp(local_label)($gp) # encoding: [0x8f,0x99,A,A]
156 # N32-NEXT: # fixup A - offset: 0, value: %got_disp(local_label), kind: fixup_Mips_GOT_DISP
157 # N32-NEXT: addiu $25, $25, 8 # encoding: [0x27,0x39,0x00,0x08]
158 # N32-NEXT: .reloc .Ltmp1, R_MIPS_JALR, local_label
160 # ELF-N32: 8f 99 00 00 lw $25, 0($gp)
161 # ELF-N32-NEXT: R_MIPS_GOT_DISP local_label
162 # ELF-N32-NEXT: 27 39 00 08 addiu $25, $25, 8
163 # ELF-N32-NEXT: 03 20 f8 09 jalr $25
164 # ELF-N32-NEXT: R_MIPS_JALR local_label
166 # XN32: lw $25, %got_disp(local_label)($gp) # encoding: [0x8f,0x99,A,A]
167 # XN32-NEXT: # fixup A - offset: 0, value: %got_disp(local_label), kind: fixup_Mips_GOT_DISP
168 # XN32-NEXT: addiu $25, $25, 8 # encoding: [0x27,0x39,0x00,0x08]
169 # XN32-NEXT: .reloc .Ltmp1, R_MIPS_JALR, local_label
171 # ELF-XN32: 8f 99 00 00 lw $25, 0($gp)
172 # ELF-XN32-NEXT: R_MIPS_GOT_DISP local_label
173 # ELF-XN32-NEXT: 27 39 00 08 addiu $25, $25, 8
174 # ELF-XN32-NEXT: 03 20 f8 09 jalr $25
175 # ELF-XN32-NEXT: R_MIPS_JALR local_label
177 # N64: ld $25, %got_disp(local_label)($gp) # encoding: [0xdf,0x99,A,A]
178 # N64-NEXT: # fixup A - offset: 0, value: %got_disp(local_label), kind: fixup_Mips_GOT_DISP
179 # N64-NEXT: daddiu $25, $25, 8 # encoding: [0x67,0x39,0x00,0x08]
180 # N64-NEXT: .reloc .Ltmp1, R_MIPS_JALR, local_label
182 # ELF-N64: df 99 00 00 ld $25, 0($gp)
183 # ELF-N64-NEXT: R_MIPS_GOT_DISP/R_MIPS_NONE/R_MIPS_NONE local_label
184 # ELF-N64-NEXT: 67 39 00 08 daddiu $25, $25, 8
185 # ELF-N64-NEXT: 03 20 f8 09 jalr $25
186 # ELF-N64-NEXT: R_MIPS_JALR/R_MIPS_NONE/R_MIPS_NONE local_label
188 # XN64: ld $25, %got_disp(local_label)($gp) # encoding: [0xdf,0x99,A,A]
189 # XN64-NEXT: # fixup A - offset: 0, value: %got_disp(local_label), kind: fixup_Mips_GOT_DISP
190 # XN64-NEXT: daddiu $25, $25, 8 # encoding: [0x67,0x39,0x00,0x08]
191 # XN64-NEXT: .reloc .Ltmp1, R_MIPS_JALR, local_label
193 # ELF-XN64: df 99 00 00 ld $25, 0($gp)
194 # ELF-XN64-NEXT: R_MIPS_GOT_DISP/R_MIPS_NONE/R_MIPS_NONE local_label
195 # ELF-XN64-NEXT: 67 39 00 08 daddiu $25, $25, 8
196 # ELF-XN64-NEXT: 03 20 f8 09 jalr $25
197 # ELF-XN64-NEXT: R_MIPS_JALR/R_MIPS_NONE/R_MIPS_NONE local_label
199 # O32-MM: lw $25, %got(local_label+8)($gp) # encoding: [0xff,0x3c,A,A]
200 # O32-MM-NEXT: # fixup A - offset: 0, value: %got(local_label+8), kind: fixup_MICROMIPS_GOT16
201 # O32-MM-NEXT: addiu $25, $25, %lo(local_label+8) # encoding: [0x33,0x39,A,A]
202 # O32-MM-NEXT: # fixup A - offset: 0, value: %lo(local_label+8), kind: fixup_MICROMIPS_LO16
203 # O32-MM-NOT: .reloc
205 # MIPS: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
206 # MM: jalr $ra, $25 # encoding: [0x03,0xf9,0x0f,0x3c]
207 # ALL: nop # encoding: [0x00,0x00,0x00,0x00]
209 jal weak_label
212 # Expanding "jal weak_label":
213 # O32: lw $25, %call16(weak_label)($gp) # encoding: [0x8f,0x99,A,A]
214 # O32: # fixup A - offset: 0, value: %call16(weak_label), kind: fixup_Mips_CALL16
215 # O32-NEXT: .reloc ($tmp1), R_MIPS_JALR, weak_label
217 # ELF-O32: 8f 99 00 00 lw $25, 0($gp)
218 # ELF-O32-NEXT: R_MIPS_CALL16 weak_label
219 # ELF-O32-NEXT: 03 20 f8 09 jalr $25
220 # ELF-O32-NEXT: R_MIPS_JALR weak_label
222 # XO32: lui $25, %call_hi(weak_label) # encoding: [0x3c,0x19,A,A]
223 # XO32-NEXT: # fixup A - offset: 0, value: %call_hi(weak_label), kind: fixup_Mips_CALL_HI16
224 # XO32-NEXT: addu $25, $25, $gp # encoding: [0x03,0x3c,0xc8,0x21]
225 # XO32-NEXT: lw $25, %call_lo(weak_label)($25) # encoding: [0x8f,0x39,A,A]
226 # XO32-NEXT: # fixup A - offset: 0, value: %call_lo(weak_label), kind: fixup_Mips_CALL_LO16
227 # XO32-NEXT: .reloc ($tmp1), R_MIPS_JALR, weak_label
229 # ELF-XO32: 3c 19 00 00 lui $25, 0
230 # ELF-XO32-MEXT: R_MIPS_CALL_HI16 weak_label
231 # ELF-XO32-MEXT: 03 3c c8 21 addu $25, $25, $gp
232 # ELF-XO32-MEXT: 8f 39 00 00 lw $25, 0($25)
233 # ELF-XO32-MEXT: R_MIPS_CALL_LO16 weak_label
234 # ELF-XO32-MEXT: 03 20 f8 09 jalr $25
235 # ELF-XO32-MEXT: R_MIPS_JALR weak_label
237 # N32: lw $25, %call16(weak_label)($gp) # encoding: [0x8f,0x99,A,A]
238 # N32: # fixup A - offset: 0, value: %call16(weak_label), kind: fixup_Mips_CALL16
239 # N32-NEXT: .reloc .Ltmp2, R_MIPS_JALR, weak_label
241 # ELF-N32: 8f 99 00 00 lw $25, 0($gp)
242 # ELF-N32-NEXT: R_MIPS_CALL16 weak_label
243 # ELF-N32-NEXT: 03 20 f8 09 jalr $25
244 # ELF-N32-NEXT: R_MIPS_JALR weak_label
246 # XN32: lui $25, %call_hi(weak_label) # encoding: [0x3c,0x19,A,A]
247 # XN32-NEXT: # fixup A - offset: 0, value: %call_hi(weak_label), kind: fixup_Mips_CALL_HI16
248 # XN32-NEXT: addu $25, $25, $gp # encoding: [0x03,0x3c,0xc8,0x21]
249 # XN32-NEXT: lw $25, %call_lo(weak_label)($25) # encoding: [0x8f,0x39,A,A]
250 # XN32-NEXT: # fixup A - offset: 0, value: %call_lo(weak_label), kind: fixup_Mips_CALL_LO16
251 # XN32-NEXT: .reloc .Ltmp2, R_MIPS_JALR, weak_label
253 # ELF-XN32: 3c 19 00 00 lui $25, 0
254 # ELF-XN32-NEXT: R_MIPS_CALL_HI16 weak_label
255 # ELF-XN32-NEXT: 03 3c c8 21 addu $25, $25, $gp
256 # ELF-XN32-NEXT: 8f 39 00 00 lw $25, 0($25)
257 # ELF-XN32-NEXT: R_MIPS_CALL_LO16 weak_label
258 # ELF-XN32-NEXT: 03 20 f8 09 jalr $25
259 # ELF-XN32-NEXT: R_MIPS_JALR weak_label
261 # N64: ld $25, %call16(weak_label)($gp) # encoding: [0xdf,0x99,A,A]
262 # N64: # fixup A - offset: 0, value: %call16(weak_label), kind: fixup_Mips_CALL16
263 # N64-NEXT: .reloc .Ltmp2, R_MIPS_JALR, weak_label
265 # ELF-N64: df 99 00 00 ld $25, 0($gp)
266 # ELF-N64-NEXT: R_MIPS_CALL16/R_MIPS_NONE/R_MIPS_NONE weak_label
267 # ELF-N64-NEXT: 03 20 f8 09 jalr $25
268 # ELF-N64-NEXT: R_MIPS_JALR/R_MIPS_NONE/R_MIPS_NONE weak_label
270 # XN64: lui $25, %call_hi(weak_label) # encoding: [0x3c,0x19,A,A]
271 # XN64-NEXT: # fixup A - offset: 0, value: %call_hi(weak_label), kind: fixup_Mips_CALL_HI16
272 # XN64-NEXT: daddu $25, $25, $gp # encoding: [0x03,0x3c,0xc8,0x2d]
273 # XN64-NEXT: ld $25, %call_lo(weak_label)($25) # encoding: [0xdf,0x39,A,A]
274 # XN64-NEXT: # fixup A - offset: 0, value: %call_lo(weak_label), kind: fixup_Mips_CALL_LO16
275 # XN64-NEXT: .reloc .Ltmp2, R_MIPS_JALR, weak_label
277 # ELF-XN64: 3c 19 00 00 lui $25, 0
278 # ELF-XN64-NEXT: R_MIPS_CALL_HI16/R_MIPS_NONE/R_MIPS_NONE weak_label
279 # ELF-XN64-NEXT: 03 3c c8 2d daddu $25, $25, $gp
280 # ELF-XN64-NEXT: df 39 00 00 ld $25, 0($25)
281 # ELF-XN64-NEXT: R_MIPS_CALL_LO16/R_MIPS_NONE/R_MIPS_NONE weak_label
282 # ELF-XN64-NEXT: 03 20 f8 09 jalr $25
283 # ELF-XN64-NEXT: R_MIPS_JALR/R_MIPS_NONE/R_MIPS_NONE weak_label
285 # O32-MM: lw $25, %call16(weak_label)($gp) # encoding: [0xff,0x3c,A,A]
286 # O32-MM: # fixup A - offset: 0, value: %call16(weak_label), kind: fixup_MICROMIPS_CALL16
287 # O32-MM-NEXT: .reloc ($tmp1), R_MICROMIPS_JALR, weak_label
289 # MIPS: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
290 # MM: jalr $ra, $25 # encoding: [0x03,0xf9,0x0f,0x3c]
291 # ALL: nop # encoding: [0x00,0x00,0x00,0x00]
293 jal weak_label+8
296 # O32: lw $25, %got(weak_label)($gp) # encoding: [0x8f,0x99,A,A]
297 # O32-NEXT: # fixup A - offset: 0, value: %got(weak_label), kind: fixup_Mips_GOT
298 # O32-NEXT: addiu $25, $25, 8 # encoding: [0x27,0x39,0x00,0x08]
299 # O32-NOT: .reloc
301 # ELF-O32: 8f 99 00 00 lw $25, 0($gp)
302 # ELF-O32-NEXT: R_MIPS_GOT16 weak_label
303 # ELF-O32-NEXT: 27 39 00 08 addiu $25, $25, 8
304 # ELF-O32-NEXT: 03 20 f8 09 jalr $25
305 # ELF-O32-NEXT: 00 00 00 00 nop
307 # XO32: lui $25, %got_hi(weak_label+8) # encoding: [0x3c,0x19,A,A]
308 # XO32-NEXT: # fixup A - offset: 0, value: %got_hi(weak_label+8), kind: fixup_Mips_GOT_HI16
309 # XO32-NEXT: addu $25, $25, $gp # encoding: [0x03,0x3c,0xc8,0x21]
310 # XO32-NEXT: lw $25, %got_lo(weak_label)($25) # encoding: [0x8f,0x39,A,A]
311 # XO32-NEXT: # fixup A - offset: 0, value: %got_lo(weak_label), kind: fixup_Mips_GOT_LO16
312 # XO32-NEXT: addiu $25, $25, 8 # encoding: [0x27,0x39,0x00,0x08]
313 # XO32-NOT: .reloc
315 # ELF-XO32: 3c 19 00 00 lui $25, 0
316 # ELF-XO32-NEXT: R_MIPS_GOT_HI16 weak_label
317 # ELF-XO32-NEXT: 03 3c c8 21 addu $25, $25, $gp
318 # ELF-XO32-NEXT: 8f 39 00 00 lw $25, 0($25)
319 # ELF-XO32-NEXT: R_MIPS_GOT_LO16 weak_label
320 # ELF-XO32-NEXT: 27 39 00 08 addiu $25, $25, 8
321 # ELF-XO32-NEXT: 03 20 f8 09 jalr $25
322 # ELF-XO32-NEXT: 00 00 00 00 nop
324 # N32: lw $25, %got_disp(weak_label)($gp) # encoding: [0x8f,0x99,A,A]
325 # N32-NEXT: # fixup A - offset: 0, value: %got_disp(weak_label), kind: fixup_Mips_GOT_DISP
326 # N32-NEXT: addiu $25, $25, 8 # encoding: [0x27,0x39,0x00,0x08]
327 # N32-NEXT: .reloc .Ltmp3, R_MIPS_JALR, weak_label
329 # ELF-N32: 8f 99 00 00 lw $25, 0($gp)
330 # ELF-N32-NEXT: R_MIPS_GOT_DISP weak_label
331 # ELF-N32-NEXT: 27 39 00 08 addiu $25, $25, 8
332 # ELF-N32-NEXT: 03 20 f8 09 jalr $25
333 # ELF-N32-NEXT: R_MIPS_JALR weak_label
335 # XN32: lui $25, %got_hi(weak_label+8) # encoding: [0x3c,0x19,A,A]
336 # XN32-NEXT: # fixup A - offset: 0, value: %got_hi(weak_label+8), kind: fixup_Mips_GOT_HI16
337 # XN32-NEXT: addu $25, $25, $gp # encoding: [0x03,0x3c,0xc8,0x21]
338 # XN32-NEXT: lw $25, %got_lo(weak_label)($25) # encoding: [0x8f,0x39,A,A]
339 # XN32-NEXT: # fixup A - offset: 0, value: %got_lo(weak_label), kind: fixup_Mips_GOT_LO16
340 # XN32-NEXT: addiu $25, $25, 8 # encoding: [0x27,0x39,0x00,0x08]
341 # XN32-NEXT: .reloc .Ltmp3, R_MIPS_JALR, weak_label
343 # ELF-XN32: 3c 19 00 00 lui $25, 0
344 # ELF-XN32-NEXT: R_MIPS_GOT_HI16 weak_label+0x8
345 # ELF-XN32-NEXT: 03 3c c8 21 addu $25, $25, $gp
346 # ELF-XN32-NEXT: 8f 39 00 00 lw $25, 0($25)
347 # ELF-XN32-NEXT: R_MIPS_GOT_LO16 weak_label
348 # ELF-XN32-NEXT: 27 39 00 08 addiu $25, $25, 8
349 # ELF-XN32-NEXT: 03 20 f8 09 jalr $25
350 # ELF-XN32-NEXT: R_MIPS_JALR weak_label
352 # N64: ld $25, %got_disp(weak_label)($gp) # encoding: [0xdf,0x99,A,A]
353 # N64: # fixup A - offset: 0, value: %got_disp(weak_label), kind: fixup_Mips_GOT_DISP
354 # N64-NEXT: daddiu $25, $25, 8 # encoding: [0x67,0x39,0x00,0x08]
355 # N64-NEXT: .reloc .Ltmp3, R_MIPS_JALR, weak_label
357 # ELF-N64: df 99 00 00 ld $25, 0($gp)
358 # ELF-N64-NEXT: R_MIPS_GOT_DISP/R_MIPS_NONE/R_MIPS_NONE weak_label
359 # ELF-N64-NEXT: 67 39 00 08 daddiu $25, $25, 8
360 # ELF-N64-NEXT: 03 20 f8 09 jalr $25
361 # ELF-N64-NEXT: R_MIPS_JALR/R_MIPS_NONE/R_MIPS_NONE weak_label
363 # XN64: lui $25, %got_hi(weak_label+8) # encoding: [0x3c,0x19,A,A]
364 # XN64-NEXT: # fixup A - offset: 0, value: %got_hi(weak_label+8), kind: fixup_Mips_GOT_HI16
365 # XN64-NEXT: daddu $25, $25, $gp # encoding: [0x03,0x3c,0xc8,0x2d]
366 # XN64-NEXT: ld $25, %got_lo(weak_label)($25) # encoding: [0xdf,0x39,A,A]
367 # XN64-NEXT: # fixup A - offset: 0, value: %got_lo(weak_label), kind: fixup_Mips_GOT_LO16
368 # XN64-NEXT: daddiu $25, $25, 8 # encoding: [0x67,0x39,0x00,0x08]
369 # XN64-NEXT: .reloc .Ltmp3, R_MIPS_JALR, weak_label
371 # ELF-XN64: 3c 19 00 00 lui $25, 0
372 # ELF-XN64-NEXT: R_MIPS_GOT_HI16/R_MIPS_NONE/R_MIPS_NONE weak_label+0x8
373 # ELF-XN64-NEXT: 03 3c c8 2d daddu $25, $25, $gp
374 # ELF-XN64-NEXT: df 39 00 00 ld $25, 0($25)
375 # ELF-XN64-NEXT: R_MIPS_GOT_LO16/R_MIPS_NONE/R_MIPS_NONE weak_label
376 # ELF-XN64-NEXT: 67 39 00 08 daddiu $25, $25, 8
377 # ELF-XN64-NEXT: 03 20 f8 09 jalr $25
378 # ELF-XN64-NEXT: R_MIPS_JALR/R_MIPS_NONE/R_MIPS_NONE weak_label
380 # O32-MM: lw $25, %got(weak_label)($gp) # encoding: [0xff,0x3c,A,A]
381 # O32-MM-NEXT: # fixup A - offset: 0, value: %got(weak_label), kind: fixup_MICROMIPS_GOT16
382 # O32-MM-NEXT: addiu $25, $25, 8 # encoding: [0x33,0x39,0x00,0x08]
383 # O32-MM-NOT: .reloc
385 # MIPS: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
386 # MM: jalr $ra, $25 # encoding: [0x03,0xf9,0x0f,0x3c]
387 # ALL: nop # encoding: [0x00,0x00,0x00,0x00]
389 jal global_label
392 # Expanding "jal global_label":
393 # O32: lw $25, %call16(global_label)($gp) # encoding: [0x8f,0x99,A,A]
394 # O32-NEXT: # fixup A - offset: 0, value: %call16(global_label), kind: fixup_Mips_CALL16
395 # O32-NEXT: .reloc ($tmp2), R_MIPS_JALR, global_label
397 # ELF-O32: 8f 99 00 00 lw $25, 0($gp)
398 # ELF-O32-NEXT: R_MIPS_CALL16 global_label
399 # ELF-O32-NEXT: 03 20 f8 09 jalr $25
400 # ELF-O32-NEXT: R_MIPS_JALR global_label
402 # XO32: lui $25, %call_hi(global_label) # encoding: [0x3c,0x19,A,A]
403 # XO32-NEXT: # fixup A - offset: 0, value: %call_hi(global_label), kind: fixup_Mips_CALL_HI16
404 # XO32-NEXT: addu $25, $25, $gp # encoding: [0x03,0x3c,0xc8,0x21]
405 # XO32-NEXT: lw $25, %call_lo(global_label)($25) # encoding: [0x8f,0x39,A,A]
406 # XO32-NEXT: # fixup A - offset: 0, value: %call_lo(global_label), kind: fixup_Mips_CALL_LO16
407 # XO32-NEXT: .reloc ($tmp2), R_MIPS_JALR, global_label
409 # ELF-XO32: 3c 19 00 00 lui $25, 0
410 # ELF-XO32-NEXT: R_MIPS_CALL_HI16 global_label
411 # ELF-XO32-NEXT: 03 3c c8 21 addu $25, $25, $gp
412 # ELF-XO32-NEXT: 8f 39 00 00 lw $25, 0($25)
413 # ELF-XO32-NEXT: R_MIPS_CALL_LO16 global_label
414 # ELF-XO32-NEXT: 03 20 f8 09 jalr $25
415 # ELF-XO32-NEXT: R_MIPS_JALR global_label
417 # N32: lw $25, %call16(global_label)($gp) # encoding: [0x8f,0x99,A,A]
418 # N32-NEXT: # fixup A - offset: 0, value: %call16(global_label), kind: fixup_Mips_CALL16
419 # N32-NEXT: .reloc .Ltmp4, R_MIPS_JALR, global_label
421 # ELF-N32: 8f 99 00 00 lw $25, 0($gp)
422 # ELF-N32-NEXT: R_MIPS_CALL16 global_label
423 # ELF-N32-NEXT: 03 20 f8 09 jalr $25
424 # ELF-N32-NEXT: R_MIPS_JALR global_label
426 # XN32: lui $25, %call_hi(global_label) # encoding: [0x3c,0x19,A,A]
427 # XN32-NEXT: # fixup A - offset: 0, value: %call_hi(global_label), kind: fixup_Mips_CALL_HI16
428 # XN32-NEXT: addu $25, $25, $gp # encoding: [0x03,0x3c,0xc8,0x21]
429 # XN32-NEXT: lw $25, %call_lo(global_label)($25) # encoding: [0x8f,0x39,A,A]
430 # XN32-NEXT: # fixup A - offset: 0, value: %call_lo(global_label), kind: fixup_Mips_CALL_LO16
431 # XN32-NEXT: .reloc .Ltmp4, R_MIPS_JALR, global_label
433 # ELF-XN32: 3c 19 00 00 lui $25, 0
434 # ELF-XN32-NEXT: R_MIPS_CALL_HI16 global_label
435 # ELF-XN32-NEXT: 03 3c c8 21 addu $25, $25, $gp
436 # ELF-XN32-NEXT: 8f 39 00 00 lw $25, 0($25)
437 # ELF-XN32-NEXT: R_MIPS_CALL_LO16 global_label
438 # ELF-XN32-NEXT: 03 20 f8 09 jalr $25
439 # ELF-XN32-NEXT: R_MIPS_JALR global_label
441 # N64: ld $25, %call16(global_label)($gp) # encoding: [0xdf,0x99,A,A]
442 # N64-NEXT: # fixup A - offset: 0, value: %call16(global_label), kind: fixup_Mips_CALL16
443 # N64-NEXT: .reloc .Ltmp4, R_MIPS_JALR, global_label
445 # ELF-N64: df 99 00 00 ld $25, 0($gp)
446 # ELF-N64-NEXT: R_MIPS_CALL16/R_MIPS_NONE/R_MIPS_NONE global_label
447 # ELF-N64-NEXT: 03 20 f8 09 jalr $25
448 # ELF-N64-NEXT: R_MIPS_JALR/R_MIPS_NONE/R_MIPS_NONE global_label
450 # XN64: lui $25, %call_hi(global_label) # encoding: [0x3c,0x19,A,A]
451 # XN64-NEXT: # fixup A - offset: 0, value: %call_hi(global_label), kind: fixup_Mips_CALL_HI16
452 # XN64-NEXT: daddu $25, $25, $gp # encoding: [0x03,0x3c,0xc8,0x2d]
453 # XN64-NEXT: ld $25, %call_lo(global_label)($25) # encoding: [0xdf,0x39,A,A]
454 # XN64-NEXT: # fixup A - offset: 0, value: %call_lo(global_label), kind: fixup_Mips_CALL_LO16
455 # XN64-NEXT: .reloc .Ltmp4, R_MIPS_JALR, global_label
457 # ELF-XN64: 3c 19 00 00 lui $25, 0
458 # ELF-XN64-NEXT: R_MIPS_CALL_HI16/R_MIPS_NONE/R_MIPS_NONE global_label
459 # ELF-XN64-NEXT: 03 3c c8 2d daddu $25, $25, $gp
460 # ELF-XN64-NEXT: df 39 00 00 ld $25, 0($25)
461 # ELF-XN64-NEXT: R_MIPS_CALL_LO16/R_MIPS_NONE/R_MIPS_NONE global_label
462 # ELF-XN64-NEXT: 03 20 f8 09 jalr $25
463 # ELF-XN64-NEXT: R_MIPS_JALR/R_MIPS_NONE/R_MIPS_NONE global_label
465 # O32-MM: lw $25, %call16(global_label)($gp) # encoding: [0xff,0x3c,A,A]
466 # O32-MM-NEXT: # fixup A - offset: 0, value: %call16(global_label), kind: fixup_MICROMIPS_CALL16
467 # O32-MM-NEXT: .reloc ($tmp2), R_MICROMIPS_JALR, global_label
469 # MIPS: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
470 # MM: jalr $ra, $25 # encoding: [0x03,0xf9,0x0f,0x3c]
471 # ALL: nop # encoding: [0x00,0x00,0x00,0x00]
473 jal global_label+8
476 # O32: lw $25, %got(global_label)($gp) # encoding: [0x8f,0x99,A,A]
477 # O32-NEXT: # fixup A - offset: 0, value: %got(global_label), kind: fixup_Mips_GOT
478 # O32-NEXT: addiu $25, $25, 8 # encoding: [0x27,0x39,0x00,0x08]
479 # O32-NOT: .reloc
481 # ELF-O32: 8f 99 00 00 lw $25, 0($gp)
482 # ELF-O32-NEXT: R_MIPS_GOT16 global_label
483 # ELF-O32-NEXT: 27 39 00 08 addiu $25, $25, 8
484 # ELF-O32-NEXT: 03 20 f8 09 jalr $25
485 # ELF-O32-NEXT: 00 00 00 00 nop
487 # XO32: lui $25, %got_hi(global_label+8) # encoding: [0x3c,0x19,A,A]
488 # XO32-NEXT: # fixup A - offset: 0, value: %got_hi(global_label+8), kind: fixup_Mips_GOT_HI16
489 # XO32-NEXT: addu $25, $25, $gp # encoding: [0x03,0x3c,0xc8,0x21]
490 # XO32-NEXT: lw $25, %got_lo(global_label)($25) # encoding: [0x8f,0x39,A,A]
491 # XO32-NEXT: # fixup A - offset: 0, value: %got_lo(global_label), kind: fixup_Mips_GOT_LO16
492 # XO32-NEXT: addiu $25, $25, 8 # encoding: [0x27,0x39,0x00,0x08]
493 # XO32-NOT: .reloc
495 # ELF-XO32: 3c 19 00 00 lui $25, 0
496 # ELF-XO32-NEXT: R_MIPS_GOT_HI16 global_label
497 # ELF-XO32-NEXT: 03 3c c8 21 addu $25, $25, $gp
498 # ELF-XO32-NEXT: 8f 39 00 00 lw $25, 0($25)
499 # ELF-XO32-NEXT: R_MIPS_GOT_LO16 global_label
500 # ELF-XO32-NEXT: 27 39 00 08 addiu $25, $25, 8
501 # ELF-XO32-NEXT: 03 20 f8 09 jalr $25
502 # ELF-XO32-NEXT: 00 00 00 00 nop
504 # N32: lw $25, %got_disp(global_label)($gp) # encoding: [0x8f,0x99,A,A]
505 # N32-NEXT: # fixup A - offset: 0, value: %got_disp(global_label), kind: fixup_Mips_GOT_DISP
506 # N32-NEXT: addiu $25, $25, 8 # encoding: [0x27,0x39,0x00,0x08]
507 # N32-NEXT: .reloc .Ltmp5, R_MIPS_JALR, global_label
509 # ELF-N32: 8f 99 00 00 lw $25, 0($gp)
510 # ELF-N32-NEXT: R_MIPS_GOT_DISP global_label
511 # ELF-N32-NEXT: 27 39 00 08 addiu $25, $25, 8
512 # ELF-N32-NEXT: 03 20 f8 09 jalr $25
513 # ELF-N32-NEXT: R_MIPS_JALR global_label
515 # XN32: lui $25, %got_hi(global_label+8) # encoding: [0x3c,0x19,A,A]
516 # XN32-NEXT: # fixup A - offset: 0, value: %got_hi(global_label+8), kind: fixup_Mips_GOT_HI16
517 # XN32-NEXT: addu $25, $25, $gp # encoding: [0x03,0x3c,0xc8,0x21]
518 # XN32-NEXT: lw $25, %got_lo(global_label)($25) # encoding: [0x8f,0x39,A,A]
519 # XN32-NEXT: # fixup A - offset: 0, value: %got_lo(global_label), kind: fixup_Mips_GOT_LO16
520 # XN32-NEXT: addiu $25, $25, 8 # encoding: [0x27,0x39,0x00,0x08]
521 # XN32-NEXT: .reloc .Ltmp5, R_MIPS_JALR, global_label
523 # ELF-XN32: 3c 19 00 00 lui $25, 0
524 # ELF-XN32-NEXT: R_MIPS_GOT_HI16 global_label+0x8
525 # ELF-XN32-NEXT: 03 3c c8 21 addu $25, $25, $gp
526 # ELF-XN32-NEXT: 8f 39 00 00 lw $25, 0($25)
527 # ELF-XN32-NEXT: R_MIPS_GOT_LO16 global_label
528 # ELF-XN32-NEXT: 27 39 00 08 addiu $25, $25, 8
529 # ELF-XN32-NEXT: 03 20 f8 09 jalr $25
530 # ELF-XN32-NEXT: R_MIPS_JALR global_label
532 # N64: ld $25, %got_disp(global_label)($gp) # encoding: [0xdf,0x99,A,A]
533 # N64-NEXT: # fixup A - offset: 0, value: %got_disp(global_label), kind: fixup_Mips_GOT_DISP
534 # N64-NEXT: daddiu $25, $25, 8 # encoding: [0x67,0x39,0x00,0x08]
535 # N64-NEXT: .reloc .Ltmp5, R_MIPS_JALR, global_label
537 # ELF-N64: df 99 00 00 ld $25, 0($gp)
538 # ELF-N64-NEXT: R_MIPS_GOT_DISP/R_MIPS_NONE/R_MIPS_NONE global_label
539 # ELF-N64-NEXT: 67 39 00 08 daddiu $25, $25, 8
540 # ELF-N64-NEXT: 03 20 f8 09 jalr $25
541 # ELF-N64-NEXT: R_MIPS_JALR/R_MIPS_NONE/R_MIPS_NONE global_label
543 # XN64: lui $25, %got_hi(global_label+8) # encoding: [0x3c,0x19,A,A]
544 # XN64-NEXT: # fixup A - offset: 0, value: %got_hi(global_label+8), kind: fixup_Mips_GOT_HI16
545 # XN64-NEXT: daddu $25, $25, $gp # encoding: [0x03,0x3c,0xc8,0x2d]
546 # XN64-NEXT: ld $25, %got_lo(global_label)($25) # encoding: [0xdf,0x39,A,A]
547 # XN64-NEXT: # fixup A - offset: 0, value: %got_lo(global_label), kind: fixup_Mips_GOT_LO16
548 # XN64-NEXT: daddiu $25, $25, 8 # encoding: [0x67,0x39,0x00,0x08]
549 # XN64-NEXT: .reloc .Ltmp5, R_MIPS_JALR, global_label
551 # ELF-XN64: 3c 19 00 00 lui $25, 0
552 # ELF-XN64-NEXT: R_MIPS_GOT_HI16/R_MIPS_NONE/R_MIPS_NONE global_label+0x8
553 # ELF-XN64-NEXT: 03 3c c8 2d daddu $25, $25, $gp
554 # ELF-XN64-NEXT: df 39 00 00 ld $25, 0($25)
555 # ELF-XN64-NEXT: R_MIPS_GOT_LO16/R_MIPS_NONE/R_MIPS_NONE global_label
556 # ELF-XN64-NEXT: 67 39 00 08 daddiu $25, $25, 8
557 # ELF-XN64-NEXT: 03 20 f8 09 jalr $25
558 # ELF-XN64-NEXT: R_MIPS_JALR/R_MIPS_NONE/R_MIPS_NONE global_label
560 # O32-MM: lw $25, %got(global_label)($gp) # encoding: [0xff,0x3c,A,A]
561 # O32-MM-NEXT: # fixup A - offset: 0, value: %got(global_label), kind: fixup_MICROMIPS_GOT16
562 # O32-MM-NEXT: addiu $25, $25, 8 # encoding: [0x33,0x39,0x00,0x08]
563 # O32-MM-NOT: .reloc
565 # MIPS: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
566 # MM: jalr $ra, $25 # encoding: [0x03,0xf9,0x0f,0x3c]
567 # ALL: nop # encoding: [0x00,0x00,0x00,0x00]
569 jal .text
572 # Expanding "jal .text":
573 # O32: lw $25, %got(.text)($gp) # encoding: [0x8f,0x99,A,A]
574 # O32-NEXT: # fixup A - offset: 0, value: %got(.text), kind: fixup_Mips_GOT
576 # ELF-O32: 8f 99 00 00 lw $25, 0($gp)
577 # ELF-O32-NEXT: R_MIPS_GOT16 .text
579 # XO32: lw $25, %got(.text)($gp) # encoding: [0x8f,0x99,A,A]
580 # XO32-NEXT: # fixup A - offset: 0, value: %got(.text), kind: fixup_Mips_GOT
581 # XO32-NEXT: addiu $25, $25, %lo(.text) # encoding: [0x27,0x39,A,A]
582 # XO32-NEXT: # fixup A - offset: 0, value: %lo(.text), kind: fixup_Mips_LO16
583 # XO32-NEXT: .reloc ($tmp3), R_MIPS_JALR, .text
585 # ELF-XO32: 8f 99 00 00 lw $25, 0($gp)
586 # ELF-XO32-NEXT: R_MIPS_GOT16 .text
587 # ELF-XO32-NEXT: 27 39 00 00 addiu $25, $25, 0
588 # ELF-XO32-NEXT: R_MIPS_LO16 .text
589 # ELF-XO32-NEXT: 03 20 f8 09 jalr $25
590 # ELF-XO32-NEXT: R_MIPS_JALR .text
592 # N32: lw $25, %got_disp(.text)($gp) # encoding: [0x8f,0x99,A,A]
593 # N32-NEXT: # fixup A - offset: 0, value: %got_disp(.text), kind: fixup_Mips_GOT_DISP
595 # ELF-N32: 8f 99 00 00 lw $25, 0($gp)
596 # ELF-N32-NEXT: R_MIPS_GOT_DISP .text
598 # XN32: lw $25, %got_disp(.text)($gp) # encoding: [0x8f,0x99,A,A]
599 # XN32-NEXT: # fixup A - offset: 0, value: %got_disp(.text), kind: fixup_Mips_GOT_DISP
600 # XN32-NEXT: .reloc .Ltmp6, R_MIPS_JALR, .text
602 # ELF-XN32: 8f 99 00 00 lw $25, 0($gp)
603 # ELF-XN32-NEXT: R_MIPS_GOT_DISP .text
604 # ELF-XN32-NEXT: 03 20 f8 09 jalr $25
605 # ELF-XN32-NEXT: R_MIPS_JALR .text
607 # N64: ld $25, %got_disp(.text)($gp) # encoding: [0xdf,0x99,A,A]
608 # N64-NEXT: # fixup A - offset: 0, value: %got_disp(.text), kind: fixup_Mips_GOT_DISP
610 # ELF-N64: df 99 00 00 ld $25, 0($gp)
611 # ELF-N64-NEXT: R_MIPS_GOT_DISP/R_MIPS_NONE/R_MIPS_NONE .text
613 # XN64: ld $25, %got_disp(.text)($gp) # encoding: [0xdf,0x99,A,A]
614 # XN64-NEXT: # fixup A - offset: 0, value: %got_disp(.text), kind: fixup_Mips_GOT_DISP
615 # XN64-NEXT: .reloc .Ltmp6, R_MIPS_JALR, .text
617 # ELF-XN64: df 99 00 00 ld $25, 0($gp)
618 # ELF-XN64-NEXT: R_MIPS_GOT_DISP/R_MIPS_NONE/R_MIPS_NONE .text
619 # ELF-XN64-NEXT: 03 20 f8 09 jalr $25
620 # ELF-XN64-NEXT: R_MIPS_JALR/R_MIPS_NONE/R_MIPS_NONE .text
622 # O32-MM: lw $25, %got(.text)($gp) # encoding: [0xff,0x3c,A,A]
623 # O32-MM-NEXT: # fixup A - offset: 0, value: %got(.text), kind: fixup_MICROMIPS_GOT16
624 # O32-MM-NEXT: addiu $25, $25, %lo(.text) # encoding: [0x33,0x39,A,A]
625 # O32-MM-NEXT: # fixup A - offset: 0, value: %lo(.text), kind: fixup_MICROMIPS_LO16
626 # O42-MM-NEXT: .reloc ($tmp3), R_MICROMIPS_JALR, .text
628 # MIPS: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
629 # MM: jalr $ra, $25 # encoding: [0x03,0xf9,0x0f,0x3c]
630 # ALL: nop # encoding: [0x00,0x00,0x00,0x00]
632 jal .text+8
635 # O32: lw $25, %got(.text+8)($gp) # encoding: [0x8f,0x99,A,A]
636 # O32-NEXT: # fixup A - offset: 0, value: %got(.text+8), kind: fixup_Mips_GOT
638 # ELF-O32: 8f 99 00 00 lw $25, 0($gp)
639 # ELF-O32-NEXT: R_MIPS_GOT16 .text
641 # XO32: lw $25, %got(.text+8)($gp) # encoding: [0x8f,0x99,A,A]
642 # XO32-NEXT: # fixup A - offset: 0, value: %got(.text+8), kind: fixup_Mips_GOT
643 # XO32-NEXT: addiu $25, $25, %lo(.text+8) # encoding: [0x27,0x39,A,A]
644 # XO32-NEXT: # fixup A - offset: 0, value: %lo(.text+8), kind: fixup_Mips_LO16
645 # XO32-NOT: .reloc
647 # ELF-XO32: 8f 99 00 00 lw $25, 0($gp)
648 # ELF-XO32-NEXT: R_MIPS_GOT16 .text
649 # ELF-XO32-NEXT: 27 39 00 08 addiu $25, $25, 8
650 # ELF-XO32-NEXT: R_MIPS_LO16 .text
651 # ELF-XO32-NEXT: 03 20 f8 09 jalr $25
652 # ELF-XO32-NEXT: 00 00 00 00 nop
654 # N32: lw $25, %got_disp(.text)($gp) # encoding: [0x8f,0x99,A,A]
655 # N32-NEXT: # fixup A - offset: 0, value: %got_disp(.text), kind: fixup_Mips_GOT_DISP
657 # ELF-N32: 8f 99 00 00 lw $25, 0($gp)
658 # ELF-N32-NEXT: R_MIPS_GOT_DISP .text
660 # XN32: lw $25, %got_disp(.text)($gp) # encoding: [0x8f,0x99,A,A]
661 # XN32-NEXT: # fixup A - offset: 0, value: %got_disp(.text), kind: fixup_Mips_GOT_DISP
662 # XN32-NEXT: addiu $25, $25, 8 # encoding: [0x27,0x39,0x00,0x08]
663 # XN32-NEXT: .reloc .Ltmp7, R_MIPS_JALR, .text
665 # ELF-XN32: 8f 99 00 00 lw $25, 0($gp)
666 # ELF-XN32-NEXT: R_MIPS_GOT_DISP .text
667 # ELF-XN32-NEXT: 27 39 00 08 addiu $25, $25, 8
668 # ELF-XN32-NEXT: 03 20 f8 09 jalr $25
669 # ELF-XN32-NEXT: R_MIPS_JALR .text
671 # N64: ld $25, %got_disp(.text)($gp) # encoding: [0xdf,0x99,A,A]
672 # N64-NEXT: # fixup A - offset: 0, value: %got_disp(.text), kind: fixup_Mips_GOT_DISP
674 # ELF-N64: df 99 00 00 ld $25, 0($gp)
675 # ELF-N64-NEXT: R_MIPS_GOT_DISP/R_MIPS_NONE/R_MIPS_NONE .text
677 # XN64: ld $25, %got_disp(.text)($gp) # encoding: [0xdf,0x99,A,A]
678 # XN64-NEXT: # fixup A - offset: 0, value: %got_disp(.text), kind: fixup_Mips_GOT_DISP
679 # XN64-NEXT: daddiu $25, $25, 8 # encoding: [0x67,0x39,0x00,0x08]
680 # XN64-NEXT: .reloc .Ltmp7, R_MIPS_JALR, .text
682 # ELF-XN64: df 99 00 00 ld $25, 0($gp)
683 # ELF-XN64-NEXT: R_MIPS_GOT_DISP/R_MIPS_NONE/R_MIPS_NONE .text
684 # ELF-XN64-NEXT: 67 39 00 08 daddiu $25, $25, 8
685 # ELF-XN64-NEXT: 03 20 f8 09 jalr $25
686 # ELF-XN64-NEXT: R_MIPS_JALR/R_MIPS_NONE/R_MIPS_NONE .text
688 # O32-MM: lw $25, %got(.text+8)($gp) # encoding: [0xff,0x3c,A,A]
689 # O32-MM-NEXT: # fixup A - offset: 0, value: %got(.text+8), kind: fixup_MICROMIPS_GOT16
690 # O32-MM-NEXT: addiu $25, $25, %lo(.text+8) # encoding: [0x33,0x39,A,A]
691 # O32-MM-NEXT: # fixup A - offset: 0, value: %lo(.text+8), kind: fixup_MICROMIPS_LO16
692 # O42-MM-NEXT: .reloc ($tmp4), R_MICROMIPS_JALR, .text
694 # MIPS: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
695 # MM: jalr $ra, $25 # encoding: [0x03,0xf9,0x0f,0x3c]
696 # ALL: nop # encoding: [0x00,0x00,0x00,0x00]
698 # local labels ($tmp symbols)
699 jal 1f
702 # Expanding "jal 1f":
703 # O32: lw $25, %got($tmp4)($gp) # encoding: [0x8f,0x99,A,A]
704 # O32-NEXT: # fixup A - offset: 0, value: %got($tmp4), kind: fixup_Mips_GOT
705 # O32-NEXT: addiu $25, $25, %lo($tmp4) # encoding: [0x27,0x39,A,A]
706 # O32-NEXT: # fixup A - offset: 0, value: %lo($tmp4), kind: fixup_Mips_LO16
707 # O32-NEXT: .reloc ($tmp5), R_MIPS_JALR, ($tmp4)
709 # ELF-O32: 8f 99 00 00 lw $25, 0($gp)
710 # ELF-O32-NEXT: R_MIPS_GOT16 .text
711 # ELF-O32-NEXT: 27 39 00 b8 addiu $25, $25, 184
712 # ELF-O32-NEXT: R_MIPS_LO16 .text
713 # ELF-O32-NEXT: 03 20 f8 09 jalr $25
714 # ELF-O32-NEXT: R_MIPS_JALR $tmp0
716 # XO32: lw $25, %got($tmp4)($gp) # encoding: [0x8f,0x99,A,A]
717 # XO32-NEXT: # fixup A - offset: 0, value: %got($tmp4), kind: fixup_Mips_GOT
718 # XO32-NEXT: addiu $25, $25, %lo($tmp4) # encoding: [0x27,0x39,A,A]
719 # XO32-NEXT: # fixup A - offset: 0, value: %lo($tmp4), kind: fixup_Mips_LO16
720 # XO32-NEXT: .reloc ($tmp5), R_MIPS_JALR, ($tmp4)
722 # ELF-XO32: 8f 99 00 00 lw $25, 0($gp)
723 # ELF-XO32-NEXT: R_MIPS_GOT16 .text
724 # ELF-XO32-NEXT: 27 39 00 d8 addiu $25, $25, 216
725 # ELF-XO32-NEXT: R_MIPS_LO16 .text
726 # ELF-XO32-NEXT: 03 20 f8 09 jalr $25
727 # ELF-XO32-NEXT: R_MIPS_JALR $tmp0
729 # N32: lw $25, %got_disp(.Ltmp8)($gp) # encoding: [0x8f,0x99,A,A]
730 # N32-NEXT: # fixup A - offset: 0, value: %got_disp(.Ltmp8), kind: fixup_Mips_GOT_DISP
732 # ELF-N32: 8f 99 00 00 lw $25, 0($gp)
733 # ELF-N32-NEXT: R_MIPS_GOT_DISP .Ltmp0
735 # XN32: lw $25, %got_disp(.Ltmp8)($gp) # encoding: [0x8f,0x99,A,A]
736 # XN32-NEXT: # fixup A - offset: 0, value: %got_disp(.Ltmp8), kind: fixup_Mips_GOT_DISP
737 # XN32-NEXT: .reloc .Ltmp9, R_MIPS_JALR, .Ltmp8
739 # ELF-XN32: 8f 99 00 00 lw $25, 0($gp)
740 # ELF-XN32-NEXT: R_MIPS_GOT_DISP .Ltmp0
741 # ELF-XN32-NEXT: 03 20 f8 09 jalr $25
742 # ELF-XN32-NEXT: R_MIPS_JALR .Ltmp0
744 # N64: ld $25, %got_disp(.Ltmp8)($gp) # encoding: [0xdf,0x99,A,A]
745 # N64-NEXT: # fixup A - offset: 0, value: %got_disp(.Ltmp8), kind: fixup_Mips_GOT_DISP
747 # ELF-N64: df 99 00 00 ld $25, 0($gp)
748 # ELF-N64-NEXT: R_MIPS_GOT_DISP/R_MIPS_NONE/R_MIPS_NONE .Ltmp0
750 # XN64: ld $25, %got_disp(.Ltmp8)($gp) # encoding: [0xdf,0x99,A,A]
751 # XN64-NEXT: # fixup A - offset: 0, value: %got_disp(.Ltmp8), kind: fixup_Mips_GOT_DISP
752 # XN64-NEXT: .reloc .Ltmp9, R_MIPS_JALR, .Ltmp8
754 # ELF-XN64: df 99 00 00 ld $25, 0($gp)
755 # ELF-XN64-NEXT: R_MIPS_GOT_DISP/R_MIPS_NONE/R_MIPS_NONE .Ltmp0
756 # ELF-XN64-NEXT: 03 20 f8 09 jalr $25
757 # ELF-XN64-NEXT: R_MIPS_JALR/R_MIPS_NONE/R_MIPS_NONE .Ltmp0
759 # O32-MM: lw $25, %got($tmp4)($gp) # encoding: [0xff,0x3c,A,A]
760 # O32-MM-NEXT: # fixup A - offset: 0, value: %got($tmp4), kind: fixup_MICROMIPS_GOT16
761 # O32-MM-NEXT: addiu $25, $25, %lo($tmp4) # encoding: [0x33,0x39,A,A]
762 # O32-MM-NEXT: # fixup A - offset: 0, value: %lo($tmp4), kind: fixup_MICROMIPS_LO16
763 # O32-MM-NEXT: .reloc ($tmp5), R_MICROMIPS_JALR, ($tmp4)
765 # MIPS: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
766 # MM: jalr $ra, $25 # encoding: [0x03,0xf9,0x0f,0x3c]
767 # ALL: nop # encoding: [0x00,0x00,0x00,0x00]
769 jal 1f+8
772 # O32: lw $25, %got(($tmp4)+8)($gp) # encoding: [0x8f,0x99,A,A]
773 # O32-NEXT: # fixup A - offset: 0, value: %got(($tmp4)+8), kind: fixup_Mips_GOT
774 # O32-NEXT: addiu $25, $25, %lo(($tmp4)+8) # encoding: [0x27,0x39,A,A]
775 # O32-NEXT: # fixup A - offset: 0, value: %lo(($tmp4)+8), kind: fixup_Mips_LO16
776 # O32-NOT: .reloc
778 # ELF-O32: 8f 99 00 00 lw $25, 0($gp)
779 # ELF-O32-NEXT: R_MIPS_GOT16 .text
780 # ELF-O32-NEXT: 27 39 00 c0 addiu $25, $25, 192
781 # ELF-O32-NEXT: R_MIPS_LO16 .text
782 # ELF-O32-NEXT: 03 20 f8 09 jalr $25
783 # ELF-O32-NEXT: 00 00 00 00 nop
785 # XO32: lw $25, %got(($tmp4)+8)($gp) # encoding: [0x8f,0x99,A,A]
786 # XO32-NEXT: # fixup A - offset: 0, value: %got(($tmp4)+8), kind: fixup_Mips_GOT
787 # XO32-NEXT: addiu $25, $25, %lo(($tmp4)+8) # encoding: [0x27,0x39,A,A]
788 # XO32-NEXT: # fixup A - offset: 0, value: %lo(($tmp4)+8), kind: fixup_Mips_LO16
789 # XO32-NOT: .reloc
791 # ELF-XO32: 8f 99 00 00 lw $25, 0($gp)
792 # ELF-XO32-NEXT: R_MIPS_GOT16 .text
793 # ELF-XO32-NEXT: 27 39 00 e0 addiu $25, $25, 224
794 # ELF-XO32-NEXT: R_MIPS_LO16 .text
795 # ELF-XO32-NEXT: 03 20 f8 09 jalr $25
796 # ELF-XO32-NEXT: 00 00 00 00 nop
798 # N32: lw $25, %got_disp(.Ltmp8)($gp) # encoding: [0x8f,0x99,A,A]
799 # N32-NEXT: # fixup A - offset: 0, value: %got_disp(.Ltmp8), kind: fixup_Mips_GOT_DISP
801 # ELF-N32: 8f 99 00 00 lw $25, 0($gp)
802 # ELF-N32-NEXT: R_MIPS_GOT_DISP .Ltmp0
804 # XN32: lw $25, %got_disp(.Ltmp8)($gp) # encoding: [0x8f,0x99,A,A]
805 # XN32-NEXT: # fixup A - offset: 0, value: %got_disp(.Ltmp8), kind: fixup_Mips_GOT_DISP
806 # XN32-NEXT: addiu $25, $25, 8 # encoding: [0x27,0x39,0x00,0x08]
807 # XN32-NEXT: .reloc .Ltmp10, R_MIPS_JALR, .Ltmp8
809 # ELF-XN32: 8f 99 00 00 lw $25, 0($gp)
810 # ELF-XN32-NEXT: R_MIPS_GOT_DISP .Ltmp0
811 # ELF-XN32-NEXT: 27 39 00 08 addiu $25, $25, 8
812 # ELF-XN32-NEXT: 03 20 f8 09 jalr $25
813 # ELF-XN32-NEXT: R_MIPS_JALR .Ltmp0
815 # N64: ld $25, %got_disp(.Ltmp8)($gp) # encoding: [0xdf,0x99,A,A]
816 # N64-NEXT: # fixup A - offset: 0, value: %got_disp(.Ltmp8), kind: fixup_Mips_GOT_DISP
818 # ELF-N64: df 99 00 00 ld $25, 0($gp)
819 # ELF-N64-NEXT: R_MIPS_GOT_DISP/R_MIPS_NONE/R_MIPS_NONE .Ltmp0
821 # XN64: ld $25, %got_disp(.Ltmp8)($gp) # encoding: [0xdf,0x99,A,A]
822 # XN64-NEXT: # fixup A - offset: 0, value: %got_disp(.Ltmp8), kind: fixup_Mips_GOT_DISP
823 # XN64-NEXT: daddiu $25, $25, 8 # encoding: [0x67,0x39,0x00,0x08]
824 # XN64-NEXT: .reloc .Ltmp10, R_MIPS_JALR, .Ltmp8
826 # ELF-XN64: df 99 00 00 ld $25, 0($gp)
827 # ELF-XN64-NEXT: R_MIPS_GOT_DISP/R_MIPS_NONE/R_MIPS_NONE .Ltmp0
828 # ELF-XN64-NEXT: 67 39 00 08 daddiu $25, $25, 8
829 # ELF-XN64-NEXT: 03 20 f8 09 jalr $25
830 # ELF-XN64-NEXT: R_MIPS_JALR/R_MIPS_NONE/R_MIPS_NONE .Ltmp0
832 # O32-MM: lw $25, %got(($tmp4)+8)($gp) # encoding: [0xff,0x3c,A,A]
833 # O32-MM-NEXT: # fixup A - offset: 0, value: %got(($tmp4)+8), kind: fixup_MICROMIPS_GOT16
834 # O32-MM-NEXT: addiu $25, $25, %lo(($tmp4)+8) # encoding: [0x33,0x39,A,A]
835 # O32-MM-NEXT: # fixup A - offset: 0, value: %lo(($tmp4)+8), kind: fixup_MICROMIPS_LO16
836 # O32-MM-NOT: .reloc
838 # MIPS: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
839 # MM: jalr $ra, $25 # encoding: [0x03,0xf9,0x0f,0x3c]
840 # ALL: nop # encoding: [0x00,0x00,0x00,0x00]
842 .local forward_local
843 jal forward_local
846 # Expanding "jal forward_local":
847 # O32-FIXME: lw $25, %got(forward_local)($gp) # encoding: [0x8f,0x99,A,A]
848 # O32-FIXME: # fixup A - offset: 0, value: %got(forward_local), kind: fixup_Mips_GOT
849 # O32-FIXME: addiu $25, $25, %lo(forward_local) # encoding: [0x27,0x39,A,A]
850 # O32-FIXME:: # fixup A - offset: 0, value: %lo(forward_local), kind: fixup_Mips_LO16
851 # O32-FIXME: .reloc ($tmp6), R_MIPS_JALR, forward_local
853 # ELF-O32: 8f 99 00 00 lw $25, 0($gp)
854 # ELF-O32-NEXT: R_MIPS_GOT16 .text
855 # ELF-O32-NEXT: 27 39 00 c4 addiu $25, $25, 196
856 # ELF-O32-NEXT: R_MIPS_LO16 .text
857 # ELF-O32-NEXT: 03 20 f8 09 jalr $25
858 # ELF-O32-NEXT: R_MIPS_JALR forward_local
860 # N32-FIXME: lw $25, %got_disp(forward_local)($gp) # encoding: [0x8f,0x99,A,A]
861 # N32-FIXME: # fixup A - offset: 0, value: %got_disp(forward_local), kind: fixup_Mips_GOT_DISP
863 # ELF-N32: 8f 99 00 00 lw $25, 0($gp)
864 # ELF-N32-NEXT: R_MIPS_GOT_DISP forward_local
866 # N64-FIXME: ld $25, %got_disp(forward_local)($gp) # encoding: [0xdf,0x99,A,A]
867 # N64-FIXME: # fixup A - offset: 0, value: %got_disp(forward_local), kind: fixup_Mips_GOT_DISP
869 # ELF-N64: df 99 00 00 ld $25, 0($gp)
870 # ELF-N64-NEXT: R_MIPS_GOT_DISP/R_MIPS_NONE/R_MIPS_NONE forward_local
872 # O32-MM-FIXME: lw $25, %got(forward_local)($gp) # encoding: [0xff,0x3c,A,A]
873 # O32-MM-FIXME: # fixup A - offset: 0, value: %got(forward_local), kind: fixup_MICROMIPS_GOT16
874 # O32-MM-FIXME: addiu $25, $25, %lo(forward_local) # encoding: [0x33,0x39,A,A]
875 # O32-MM-FIXME: # fixup A - offset: 0, value: %lo(forward_local), kind: fixup_MICROMIPS_LO16
876 # O32-MM-FIXME: .reloc ($tmp6), R_MIPS_JALR, forward_local
878 # MIPS: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
879 # MM: jalr $ra, $25 # encoding: [0x03,0xf9,0x0f,0x3c]
880 # ALL: nop # encoding: [0x00,0x00,0x00,0x00]
882 .local forward_local
883 jal forward_local+8
886 # O32-FIXME: lw $25, %got(forward_local+8)($gp) # encoding: [0x8f,0x99,A,A]
887 # O32-FIXME: # fixup A - offset: 0, value: %got(forward_local+8), kind: fixup_Mips_GOT
888 # O32-FIXME: addiu $25, $25, %lo(forward_local+8) # encoding: [0x27,0x39,A,A]
889 # O32-FIXME:: # fixup A - offset: 0, value: %lo(forward_local+8), kind: fixup_Mips_LO16
890 # O32-FIXME: .reloc ($tmp7), R_MIPS_JALR, forward_local
892 # ELF-O32: 8f 99 00 00 lw $25, 0($gp)
893 # ELF-O32-NEXT: R_MIPS_GOT16 .text
894 # ELF-O32-NEXT: 27 39 00 cc addiu $25, $25, 204
895 # ELF-O32-NEXT: R_MIPS_LO16 .text
896 # ELF-O32-NEXT: 03 20 f8 09 jalr $25
897 # ELF-O32-NEXT: 00 00 00 00 nop
899 # N32-FIXME: lw $25, %got_disp(forward_local)($gp) # encoding: [0x8f,0x99,A,A]
900 # N32-FIXME: # fixup A - offset: 0, value: %got_disp(forward_local), kind: fixup_Mips_GOT_DISP
902 # ELF-N32: 8f 99 00 00 lw $25, 0($gp)
903 # ELF-N32-NEXT: R_MIPS_GOT_DISP forward_local
905 # N64-FIXME: ld $25, %got_disp(forward_local)($gp) # encoding: [0xdf,0x99,A,A]
906 # N64-FIXME: # fixup A - offset: 0, value: %got_disp(forward_local), kind: fixup_Mips_GOT_DISP
908 # ELF-N64: df 99 00 00 ld $25, 0($gp)
909 # ELF-N64-NEXT: R_MIPS_GOT_DISP/R_MIPS_NONE/R_MIPS_NONE forward_local
911 # O32-MM-FIXME: lw $25, %got(forward_local)($gp) # encoding: [0xff,0x3c,A,A]
912 # O32-MM-FIXME: # fixup A - offset: 0, value: %got(forward_local), kind: fixup_MICROMIPS_GOT16
913 # O32-MM-FIXME: addiu $25, $25, %lo(forward_local) # encoding: [0x33,0x39,A,A]
914 # O32-MM-FIXME: # fixup A - offset: 0, value: %lo(forward_local), kind: fixup_MICROMIPS_LO16
915 # O32-MM-FIXME: .reloc ($tmp6), R_MIPS_JALR, forward_local
917 # MIPS: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
918 # MM: jalr $ra, $25 # encoding: [0x03,0xf9,0x0f,0x3c]
919 # ALL: nop # encoding: [0x00,0x00,0x00,0x00]
921 .end local_label
925 add $8, $8, $8
927 forward_local: