MIPS/GAS: Don't convert PC-relative REL relocs against absolute symbols
[deliverable/binutils-gdb.git] / ld / testsuite / ld-mips-elf / mips-elf.exp
1 # Expect script for MIPS ELF linker tests
2 # Copyright (C) 2002-2016 Free Software Foundation, Inc.
3 #
4 # This file is part of the GNU Binutils.
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20 #
21
22 if {[istarget "mips*-*-vxworks"]} {
23 set mipsvxtests {
24 {"VxWorks shared library test 1" "-shared -Tvxworks1.ld" ""
25 "-mips2" {vxworks1-lib.s}
26 {{readelf --relocs vxworks1-lib.rd} {objdump -dr vxworks1-lib.dd}
27 {readelf --symbols vxworks1-lib.nd} {readelf -d vxworks1-lib.td}}
28 "libvxworks1.so"}
29 {"VxWorks executable test 1 (dynamic)" \
30 "tmpdir/libvxworks1.so -Tvxworks1.ld -q --force-dynamic" ""
31 "-mips2" {vxworks1.s}
32 {{readelf --relocs vxworks1.rd} {objdump -dr vxworks1.dd}}
33 "vxworks1"}
34 {"VxWorks executable test 2 (dynamic)" \
35 "-Tvxworks1.ld -q --force-dynamic" ""
36 "-mips2" {vxworks2.s}
37 {{readelf --segments vxworks2.sd}}
38 "vxworks2"}
39 {"VxWorks executable test 2 (static)"
40 "-Tvxworks1.ld" ""
41 "-mips2" {vxworks2.s}
42 {{readelf --segments vxworks2-static.sd}}
43 "vxworks2"}
44 }
45 run_ld_link_tests $mipsvxtests
46 run_dump_test "vxworks1-static"
47 run_dump_test "vxworks-forced-local-1"
48 return
49 }
50
51 if {![istarget mips*-*-*] || ![is_elf_format]} {
52 return
53 }
54
55 set has_newabi [expr [istarget *-*-irix6*] \
56 || [istarget mips*-*-linux*] \
57 || [istarget mips*-sde-elf*] \
58 || [istarget mips*-mti-elf*] \
59 || [istarget mips*-img-elf*]]
60 set linux_gnu [expr [istarget mips*-*-linux*]]
61 set embedded_elf [expr [istarget mips*-*-elf]]
62
63 # Set defaults.
64 set abi_asflags(o32) "-32"
65 set abi_asflags(n32) "-march=from-abi -n32 -EB"
66 set abi_asflags(n64) "-march=from-abi -64 -EB"
67 set abi_ldflags(o32) ""
68 set abi_ldflags(n32) -melf32bmipn32
69 set abi_ldflags(n64) -melf64bmip
70
71 # Override as needed.
72 if { [istarget *-*-irix6*] } {
73 set abi_asflags(o32) "-32 -EB"
74 set abi_ldflags(o32) -melf32bsmip
75 } elseif { [istarget mips64*-linux*] } {
76 set abi_asflags(o32) "-32 -EB"
77 set abi_ldflags(o32) -melf32btsmip
78 } elseif { [istarget mips64*-*freebsd*] } {
79 set abi_asflags(o32) "-32 -EB"
80 set abi_ldflags(o32) -melf32btsmip_fbsd
81 }
82 if { [istarget mips*-*-linux*] || [istarget mips*-sde-elf*]
83 || [istarget mips*-mti-elf*] || [istarget mips*-img-elf*]} {
84 set abi_ldflags(n32) -melf32btsmipn32
85 set abi_ldflags(n64) -melf64btsmip
86 } elseif { [istarget mips64*-*freebsd*] } {
87 set abi_ldflags(n32) -melf32btsmipn32_fbsd
88 set abi_ldflags(n64) -melf64btsmip_fbsd
89 }
90
91 if { $linux_gnu } {
92 run_ld_link_tests [list \
93 [list "Dummy shared library for MIPS16 PIC test 1" \
94 "-shared -melf32btsmip" "" \
95 "-EB -32 -mips1" \
96 { mips16-pic-1-dummy.s } \
97 {} \
98 "mips16-pic-1-dummy.so"] \
99 [list "MIPS16 PIC test 1" \
100 "-melf32btsmip -T mips16-pic-1.ld tmpdir/mips16-pic-1-dummy.so" "" \
101 "-EB -32 -mips1 -I $srcdir/$subdir" \
102 { mips16-pic-1a.s mips16-pic-1b.s } \
103 { { objdump { -dr -j.text } mips16-pic-1.dd }
104 { readelf -A mips16-pic-1.gd } } \
105 "mips16-pic-1"] \
106 [list "MIPS16 PIC test 2" \
107 "-melf32btsmip -T mips16-pic-1.ld -shared" "" \
108 "-EB -32 -mips1 -I $srcdir/$subdir" \
109 { mips16-pic-2a.s mips16-pic-2b.s } \
110 { { objdump { -dr -j.text } mips16-pic-2.dd } \
111 { readelf -A mips16-pic-2.gd } \
112 { readelf --symbols mips16-pic-2.nd } \
113 { readelf --relocs mips16-pic-2.rd } \
114 { readelf -d mips16-pic-2.ad } } \
115 "mips16-pic-2"] \
116 [list "MIPS16 PIC test 3" \
117 "-melf32btsmip -T mips16-pic-1.ld tmpdir/mips16-pic-1-dummy.so" "" \
118 "-EB -32 -mips1 -I $srcdir/$subdir" \
119 { mips16-pic-3a.s mips16-pic-3b.s } \
120 { { objdump -dr mips16-pic-3.dd } \
121 { readelf --relocs mips16-pic-3.rd } \
122 { readelf -A mips16-pic-3.gd } } \
123 "mips16-pic-3"] \
124 [list "MIPS16 PIC test 4 (shared library)" \
125 "-shared -melf32btsmip -T mips16-pic-1.ld --version-script mips16-pic-4.ver" "" \
126 "-EB -32 -mips1" \
127 { mips16-pic-4a.s mips16-pic-4b.s } \
128 { { objdump -dr mips16-pic-4a.dd } \
129 { readelf --symbols mips16-pic-4a.nd } \
130 { readelf -A mips16-pic-4a.gd } } \
131 "mips16-pic-4.so"] \
132 [list "MIPS16 PIC test 4 (executable)" \
133 "-melf32btsmip -T mips16-pic-1.ld tmpdir/mips16-pic-4.so" "" \
134 "-EB -32 -mips1" \
135 { mips16-pic-4c.s } \
136 { { objdump -dr mips16-pic-4b.dd } } \
137 "mips16-pic-4"]]
138 }
139
140 # Check MIPS16 markings being passed through link.
141 run_dump_test "mips16-1"
142
143 # MIPS branch offset final link checking.
144 run_dump_test "branch-misc-1"
145 run_dump_test "branch-misc-2"
146 run_dump_test "branch-absolute" [list [list ld $abi_ldflags(o32)]]
147 run_dump_test "branch-absolute-addend" [list [list ld $abi_ldflags(o32)]]
148 if $has_newabi {
149 run_dump_test "branch-absolute-n32" [list [list ld $abi_ldflags(n32)]]
150 run_dump_test "branch-absolute-addend-n32" \
151 [list [list ld $abi_ldflags(n32)]]
152 run_dump_test "branch-absolute-n64" [list [list ld $abi_ldflags(n64)]]
153 run_dump_test "branch-absolute-addend-n64" \
154 [list [list ld $abi_ldflags(n64)]]
155 }
156
157 run_dump_test "mips16-branch-2" [list [list ld $abi_ldflags(o32)]]
158 run_dump_test "mips16-branch-3" [list [list ld $abi_ldflags(o32)]]
159 run_dump_test "mips16-branch-addend-2" [list [list ld $abi_ldflags(o32)]]
160 run_dump_test "mips16-branch-addend-3" [list [list ld $abi_ldflags(o32)]]
161 run_dump_test "mips16-branch-absolute" [list [list ld $abi_ldflags(o32)]]
162 run_dump_test "mips16-branch-absolute-addend" \
163 [list [list ld $abi_ldflags(o32)]]
164 if $has_newabi {
165 run_dump_test "mips16-branch-absolute-n32" \
166 [list [list ld $abi_ldflags(n32)]]
167 run_dump_test "mips16-branch-absolute-addend-n32" \
168 [list [list ld $abi_ldflags(n32)]]
169 run_dump_test "mips16-branch-absolute-n64" \
170 [list [list ld $abi_ldflags(n64)]]
171 run_dump_test "mips16-branch-absolute-addend-n64" \
172 [list [list ld $abi_ldflags(n64)]]
173 }
174
175 run_dump_test "micromips-branch-absolute" [list [list ld $abi_ldflags(o32)]]
176 run_dump_test "micromips-branch-absolute-addend" \
177 [list [list ld $abi_ldflags(o32)]]
178 if $has_newabi {
179 run_dump_test "micromips-branch-absolute-n32" \
180 [list [list ld $abi_ldflags(n32)]]
181 run_dump_test "micromips-branch-absolute-addend-n32" \
182 [list [list ld $abi_ldflags(n32)]]
183 run_dump_test "micromips-branch-absolute-n64" \
184 [list [list ld $abi_ldflags(n64)]]
185 run_dump_test "micromips-branch-absolute-addend-n64" \
186 [list [list ld $abi_ldflags(n64)]]
187 }
188
189 # Jalx test
190 run_dump_test "jalx-1"
191
192 if { $linux_gnu } {
193 run_ld_link_tests [list \
194 [list "Dummy shared library for JALX test 2" \
195 "-shared -nostdlib -melf32btsmip" "" \
196 "-G0 -EB -mmicromips -no-mdebug -mabi=32 -march=mips32r2 -KPIC" \
197 { jalx-2-printf.s } \
198 {} \
199 "libjalx-2.so"] \
200 [list "Dummy external function for JALX test 2" \
201 "-r -melf32btsmip" "" \
202 "-G0 -EB -no-mdebug -mabi=32 -march=mips32r2 -mno-shared -call_nonpic" \
203 { jalx-2-ex.s } \
204 {} \
205 "jalx-2-ex.o.r"] \
206 [list "MIPS JALX test 2" \
207 "-nostdlib -T jalx-2.ld tmpdir/libjalx-2.so tmpdir/jalx-2-ex.o.r -melf32btsmip" "" \
208 "-G0 -EB -mmicromips -no-mdebug -mabi=32 -march=mips32r2 -mno-shared -call_nonpic" \
209 { jalx-2-main.s } \
210 { { objdump -d jalx-2.dd } } \
211 "jalx-2"]]
212 }
213
214 run_dump_test "jalx-addend" [list [list ld $abi_ldflags(o32)]]
215 run_dump_test "jalx-local" [list [list ld $abi_ldflags(o32)]]
216 if $has_newabi {
217 run_dump_test "jalx-addend-n32" [list [list ld $abi_ldflags(n32)]]
218 run_dump_test "jalx-local-n32" [list [list ld $abi_ldflags(n32)]]
219 run_dump_test "jalx-addend-n64" [list [list ld $abi_ldflags(n64)]]
220 run_dump_test "jalx-local-n64" [list [list ld $abi_ldflags(n64)]]
221 }
222
223 run_dump_test "unaligned-jalx-0" [list [list ld $abi_ldflags(o32)]]
224 run_dump_test "unaligned-jalx-1" [list [list ld $abi_ldflags(o32)]]
225 run_dump_test "unaligned-jalx-mips16-0" [list [list ld $abi_ldflags(o32)]]
226 run_dump_test "unaligned-jalx-mips16-1" [list [list ld $abi_ldflags(o32)]]
227 run_dump_test "unaligned-jalx-micromips-0" [list [list ld $abi_ldflags(o32)]]
228 run_dump_test "unaligned-jalx-micromips-1" [list [list ld $abi_ldflags(o32)]]
229
230 if $has_newabi {
231 run_dump_test "unaligned-jalx-addend-0" \
232 [list [list ld $abi_ldflags(n32)]]
233 run_dump_test "unaligned-jalx-addend-1" \
234 [list [list ld $abi_ldflags(n32)]]
235 run_dump_test "unaligned-jalx-addend-mips16-0" \
236 [list [list ld $abi_ldflags(n32)]]
237 run_dump_test "unaligned-jalx-addend-mips16-1" \
238 [list [list ld $abi_ldflags(n32)]]
239 run_dump_test "unaligned-jalx-addend-micromips-0" \
240 [list [list ld $abi_ldflags(n32)]]
241 run_dump_test "unaligned-jalx-addend-micromips-1" \
242 [list [list ld $abi_ldflags(n32)]]
243 }
244
245 run_dump_test "unaligned-branch" [list [list ld $abi_ldflags(o32)]]
246
247 run_dump_test "unaligned-lwpc-0" [list [list ld $abi_ldflags(o32)]]
248 run_dump_test "unaligned-lwpc-1" [list [list ld $abi_ldflags(o32)]]
249 run_dump_test "unaligned-ldpc-0" [list [list ld $abi_ldflags(o32)]]
250 run_dump_test "unaligned-ldpc-1" [list [list ld $abi_ldflags(o32)]]
251
252 # Test multi-got link. We only do this on GNU/Linux because it requires
253 # the "traditional" emulations.
254 if { $linux_gnu } {
255 run_dump_test "multi-got-1"
256 run_dump_test "multi-got-no-shared"
257 run_dump_test "multi-got-hidden-1"
258 run_dump_test "multi-got-hidden-2"
259 }
260
261 # Test __gnu_local_gp accesses
262 if { $linux_gnu } {
263 run_dump_test "no-shared-1-o32"
264 if { $has_newabi } {
265 run_dump_test "no-shared-1-n32"
266 run_dump_test "no-shared-1-n64"
267 }
268 }
269
270 # Test PIE debug dynamic tags
271 if { $linux_gnu } {
272 run_dump_test "pie-o32"
273 if { $has_newabi } {
274 run_dump_test "pie-n32"
275 run_dump_test "pie-n64"
276 }
277 }
278
279 if $has_newabi {
280 if { $embedded_elf } {
281 run_dump_test "elf-rel-got-n32-embed" \
282 [list [list ld $abi_ldflags(n32)]]
283 run_dump_test "elf-rel-xgot-n32-embed" \
284 [list [list ld $abi_ldflags(n32)]]
285 } else {
286 run_dump_test "elf-rel-got-n32" [list [list ld $abi_ldflags(n32)]]
287 run_dump_test "elf-rel-xgot-n32" [list [list ld $abi_ldflags(n32)]]
288 }
289 if { $linux_gnu } {
290 run_dump_test "elf-rel-got-n64-linux" \
291 [list [list ld $abi_ldflags(n64)]]
292 run_dump_test "elf-rel-xgot-n64-linux" \
293 [list [list ld $abi_ldflags(n64)]]
294 } elseif { $embedded_elf } {
295 run_dump_test "elf-rel-got-n64-embed" \
296 [list [list ld $abi_ldflags(n64)]]
297 run_dump_test "elf-rel-xgot-n64-embed" \
298 [list [list ld $abi_ldflags(n64)]]
299 } else {
300 run_dump_test "elf-rel-got-n64" [list [list ld $abi_ldflags(n64)]]
301 run_dump_test "elf-rel-xgot-n64" [list [list ld $abi_ldflags(n64)]]
302 }
303
304 run_dump_test "relax-jalr-n32"
305 run_dump_test "relax-jalr-n32-shared"
306 run_dump_test "relax-jalr-n64"
307 run_dump_test "relax-jalr-n64-shared"
308 }
309
310 if { $linux_gnu } {
311 run_dump_test "rel32-o32"
312 if { $has_newabi } {
313 run_dump_test "rel32-n32"
314 run_dump_test "rel64"
315 }
316 # The first test checks that a mixed PIC/non-PIC relocatable link
317 # will not introduce any stubs itself, but will flag PIC functions
318 # for the final link.
319 #
320 # The second test checks that we insert stubs for calls from
321 # non-PIC functions to PIC functions when linking the original
322 # two objects together.
323 #
324 # The third test checks that we do the same when linking the
325 # result of the first link (with no other source files).
326 run_ld_link_tests {
327 {"PIC and non-PIC test 1 (relocatable)" "-r -melf32btsmip" ""
328 "-32 -EB -mips2" {pic-and-nonpic-1a.s pic-and-nonpic-1b.s}
329 {{objdump -dr pic-and-nonpic-1-rel.dd}
330 {readelf --symbols pic-and-nonpic-1-rel.nd}}
331 "pic-and-nonpic-1-rel.o"}
332 {"PIC and non-PIC test 1 (static 1)"
333 "-melf32btsmip -Tpic-and-nonpic-1.ld" ""
334 "-32 -EB -mips2" {pic-and-nonpic-1a.s pic-and-nonpic-1b.s}
335 {{objdump -dr pic-and-nonpic-1.dd}
336 {readelf --symbols pic-and-nonpic-1.nd}}
337 "pic-and-nonpic-1-static1.o"}
338 {"PIC and non-PIC test 1 (static 2)"
339 "-melf32btsmip -Tpic-and-nonpic-1.ld tmpdir/pic-and-nonpic-1-rel.o" ""
340 "" {}
341 {{objdump -dr pic-and-nonpic-1.dd}
342 {readelf --symbols pic-and-nonpic-1.nd}}
343 "pic-and-nonpic-1-static2.o"}
344 }
345 run_dump_test "pic-and-nonpic-2"
346 run_ld_link_tests {
347 {"PIC and non-PIC test 3 (shared library)"
348 "-melf32btsmip -shared -Tpic-and-nonpic-3a.ld" ""
349 "-32 -EB -mips2" {pic-and-nonpic-3a.s}
350 {{readelf --segments pic-and-nonpic-3a.sd}
351 {readelf -A pic-and-nonpic-3a.gd}
352 {objdump -dr pic-and-nonpic-3a.dd}}
353 "pic-and-nonpic-3a.so"}
354 {"PIC and non-PIC test 3 (executable)"
355 "-melf32btsmip -Tpic-and-nonpic-3b.ld tmpdir/pic-and-nonpic-3a.so" ""
356 "-32 -EB -mips2" {pic-and-nonpic-3b.s}
357 {{readelf --segments pic-and-nonpic-3b.sd}
358 {objdump -dr pic-and-nonpic-3b.dd}
359 {objdump {-s -j.got.plt} pic-and-nonpic-3b.pd}
360 {readelf -A pic-and-nonpic-3b.gd}
361 {readelf --relocs pic-and-nonpic-3b.rd}
362 {readelf --symbols pic-and-nonpic-3b.nd}
363 {readelf -d pic-and-nonpic-3b.ad}}
364 "pic-and-nonpic-3b"}
365 }
366 run_dump_test "pic-and-nonpic-3-error"
367 run_ld_link_tests {
368 {"PIC and non-PIC test 4 (shared library)"
369 "-melf32btsmip -shared -Tpic-and-nonpic-3a.ld" ""
370 "-32 -EB -mips2" {pic-and-nonpic-4a.s}
371 {}
372 "pic-and-nonpic-4a.so"}
373 {"PIC and non-PIC test 4 (executable)"
374 "-melf32btsmip -Tpic-and-nonpic-4b.ld tmpdir/pic-and-nonpic-4a.so" ""
375 "-32 -EB -mips2" {pic-and-nonpic-4b.s}
376 {{readelf --segments pic-and-nonpic-4b.sd}
377 {objdump -dr pic-and-nonpic-4b.dd}
378 {objdump {-s -j.got -j.data} pic-and-nonpic-4b.gd}
379 {readelf --relocs pic-and-nonpic-4b.rd}
380 {readelf --symbols pic-and-nonpic-4b.nd}
381 {readelf -d pic-and-nonpic-4b.ad}}
382 "pic-and-nonpic-4b"}
383 }
384 run_dump_test "pic-and-nonpic-4-error"
385 run_ld_link_tests {
386 {"PIC and non-PIC test 5 (executable)"
387 "-melf32btsmip -Tpic-and-nonpic-5b.ld tmpdir/pic-and-nonpic-3a.so tmpdir/pic-and-nonpic-4a.so" ""
388 "-32 -EB -mips2" {pic-and-nonpic-5a.s pic-and-nonpic-5b.s}
389 {{readelf --segments pic-and-nonpic-5b.sd}
390 {objdump -dr pic-and-nonpic-5b.dd}
391 {objdump {-s -j.got.plt -j.data} pic-and-nonpic-5b.pd}
392 {readelf -A pic-and-nonpic-5b.gd}
393 {readelf --relocs pic-and-nonpic-5b.rd}
394 {readelf --symbols pic-and-nonpic-5b.nd}
395 {readelf -d pic-and-nonpic-5b.ad}}
396 "pic-and-nonpic-5b"}
397 }
398 set abis { o32 -32 elf32btsmip }
399 if $has_newabi {
400 lappend abis n32 -n32 elf32btsmipn32
401 lappend abis n64 -64 elf64btsmip
402 }
403 foreach { abi flag emul } $abis {
404 run_ld_link_tests [list \
405 [list "PIC and non-PIC test 6 ($abi shared library)" \
406 "-m$emul -shared -Tpic-and-nonpic-3a.ld" "" \
407 "$flag -EB -mips3" \
408 [list "pic-and-nonpic-6-${abi}a.s"] {} \
409 "pic-and-nonpic-6-${abi}.so"] \
410 [list "PIC and non-PIC test 6 ($abi executable)" \
411 "-m$emul -Tpic-and-nonpic-6.ld tmpdir/pic-and-nonpic-6-${abi}.so" "" \
412 "$flag -EB -mips3" \
413 [list "pic-and-nonpic-6-${abi}b.s" \
414 "pic-and-nonpic-6-${abi}c.s"] \
415 [list "readelf {--wide --segments} pic-and-nonpic-6-${abi}.sd" \
416 "objdump -dr pic-and-nonpic-6-${abi}.dd" \
417 "objdump {-s -j.got.plt} pic-and-nonpic-6-${abi}.pd" \
418 "readelf -A pic-and-nonpic-6-${abi}.gd" \
419 "readelf --relocs pic-and-nonpic-6-${abi}.rd" \
420 "readelf --symbols pic-and-nonpic-6-${abi}.nd" \
421 "readelf -d pic-and-nonpic-6-${abi}.ad"] \
422 "pic-and-nonpic-6-${abi}"]]
423
424 # This checks whether our linker scripts get the scope of _gp right,
425 # and must therefore use default scripts. If they don't, then -- in
426 # addition to dumps failing to match -- the final link fails with:
427 #
428 # ld: gp-hidden.o: undefined reference to symbol '_gp'
429 # ld: note: '_gp' is defined in DSO ./tmpdir/gp-hidden-lib-${abi}.so
430 # so try adding it to the linker command line
431 #
432 set suff64 [string map {o32 "" n32 "" n64 -64} $abi]
433 run_ld_link_tests [list \
434 [list \
435 "_gp scope test ($abi shared library)" \
436 "$abi_ldflags($abi) -shared" "" \
437 "$abi_asflags($abi) -KPIC" \
438 { gp-hidden-lib.s } \
439 [list \
440 "readelf --relocs gp-hidden-lib${suff64}.rd" \
441 "readelf --syms gp-hidden.sd"] \
442 "gp-hidden-lib-${abi}.so"] \
443 [list \
444 "_gp scope test ($abi versioned library)" \
445 "$abi_ldflags($abi) -shared -version-script gp-hidden-ver.ver tmpdir/gp-hidden-lib-${abi}.so" "" \
446 "$abi_asflags($abi) -KPIC" \
447 { gp-hidden-ver.s } \
448 [list \
449 "readelf --relocs gp-hidden-ver${suff64}.rd" \
450 "readelf --syms gp-hidden.sd"] \
451 "gp-hidden-ver-${abi}.so"] \
452 [list \
453 "_gp scope test ($abi executable)" \
454 "$abi_ldflags($abi) -e 0 -rpath-link . tmpdir/gp-hidden-ver-${abi}.so" "" \
455 "$abi_asflags($abi) -call_nonpic" \
456 { gp-hidden.s } \
457 [list \
458 "readelf --relocs gp-hidden${suff64}.rd" \
459 "readelf --syms gp-hidden.sd"] \
460 "gp-hidden-${abi}"]]
461 }
462 }
463
464 if { $embedded_elf } {
465 run_dump_test "region1"
466 }
467
468 if $embedded_elf {
469 # This could work on other targets too, but would need the appropriate
470 # ld -m switch.
471 run_dump_test "reloc-1-rel"
472 }
473 if $has_newabi {
474 run_dump_test "reloc-1-n32" [list [list ld $abi_ldflags(n32)]]
475 run_dump_test "reloc-1-n64" [list [list ld $abi_ldflags(n64)]]
476 }
477 run_dump_test "reloc-2"
478 run_dump_test "reloc-merge-lo16"
479 run_dump_test "reloc-3"
480 if {$has_newabi} {
481 run_dump_test "reloc-3-n32"
482 }
483 run_dump_test "reloc-4"
484 run_dump_test "reloc-5"
485 if { $has_newabi } {
486 run_ld_link_tests [list \
487 [list \
488 "reloc test 6a" \
489 "-shared $abi_ldflags(n32)" "" \
490 "$abi_asflags(n32)" \
491 "reloc-6a.s" \
492 {} \
493 "reloc-6a.so"] \
494 [list \
495 "reloc test 6b" \
496 "$abi_ldflags(n32) tmpdir/reloc-6a.so" "" \
497 "$abi_asflags(n32)" \
498 "reloc-6b.s" \
499 {} \
500 "reloc-6b"]]
501 }
502
503 run_dump_test "reloc-local-overflow" [list [list ld $abi_ldflags(o32)]]
504
505 if {$has_newabi && $linux_gnu} {
506 run_dump_test "eh-frame1-n32"
507 run_dump_test "eh-frame1-n64"
508 run_dump_test "eh-frame2-n32"
509 run_dump_test "eh-frame2-n64"
510 }
511 if {$embedded_elf} {
512 run_dump_test "eh-frame3"
513 run_dump_test "eh-frame4"
514 }
515 if {$linux_gnu} {
516 set eh_frame5_test {
517 {"MIPS eh-frame 5"
518 "-melf32btsmip -shared -Teh-frame5.ld" ""
519 "-32 -EB"
520 {eh-frame5.s}
521 {{readelf {--relocs -wf} eh-frame5.d}}
522 "eh-frame5.so"}
523 }
524 run_ld_link_tests $eh_frame5_test
525 }
526
527 if {$embedded_elf} {
528 run_dump_test "compact-eh1"
529 run_dump_test "compact-eh2"
530 run_dump_test "compact-eh3"
531 }
532
533 if {$linux_gnu} {
534 run_dump_test "compact-eh4"
535 run_dump_test "compact-eh5"
536 run_dump_test "compact-eh6"
537 }
538
539 run_dump_test "jaloverflow"
540 run_dump_test "jaloverflow-2"
541
542 run_dump_test "jal-global-overflow-0" [list [list ld $abi_ldflags(o32)]]
543 run_dump_test "jal-global-overflow-1" [list [list ld $abi_ldflags(o32)]]
544 run_dump_test "jal-local-overflow-0" [list [list ld $abi_ldflags(o32)]]
545 run_dump_test "jal-local-overflow-1" [list [list ld $abi_ldflags(o32)]]
546
547 run_dump_test "undefweak-overflow" [list [list as $abi_asflags(o32)] \
548 [list ld $abi_ldflags(o32)]]
549
550 if {$has_newabi} {
551 run_dump_test "undefweak-overflow" [list [list name (n32)] \
552 [list as $abi_asflags(n32)] \
553 [list ld $abi_ldflags(n32)]]
554 run_dump_test "undefweak-overflow" [list [list name (n64)] \
555 [list as $abi_asflags(n64)] \
556 [list ld $abi_ldflags(n64)]]
557 }
558
559 if {$has_newabi} {
560 run_dump_test "jalbal" [list [list ld $abi_ldflags(n32)]]
561 }
562
563 run_dump_test "mode-change-error-1"
564
565 run_dump_test "mips16-hilo"
566 if {$has_newabi} {
567 run_dump_test "mips16-hilo-n32"
568 }
569
570 if { $linux_gnu } {
571 if { $has_newabi } {
572 run_dump_test "textrel-1"
573 }
574 run_dump_test "got-page-1"
575 if $has_newabi {
576 run_dump_test "got-page-2"
577 run_dump_test "dyn-sec64"
578 }
579 run_dump_test "got-page-3"
580 run_ld_link_tests [subst {
581 {"GOT page 4 (one file)" "-shared $abi_ldflags(o32) -T got-page-1.ld"
582 "" "$abi_asflags(o32) -mips2" {got-page-4b.s}
583 {{objdump -dr got-page-4a.d}
584 {readelf -A got-page-4a.got}}
585 "got-page-4a.so"}
586 {"GOT page 4 (two files)" "-shared $abi_ldflags(o32) -T got-page-1.ld"
587 "" "$abi_asflags(o32) -mips2" {got-page-4a.s got-page-4b.s}
588 {{objdump -dr got-page-4b.d}
589 {readelf -A got-page-4b.got}}
590 "got-page-4b.so"}
591 }]
592 if $has_newabi {
593 run_ld_link_tests [subst {
594 {"GOT page 5" "-shared $abi_ldflags(n32) -T got-page-1.ld"
595 "" "$abi_asflags(n32)" {got-page-5.s}
596 {{objdump -dr got-page-5.d}
597 {readelf -A got-page-5.got}}
598 "got-page-5.so"}
599 {"GOT page 6" "-shared $abi_ldflags(n32) -T got-page-1.ld"
600 "" "$abi_asflags(n32)" {got-page-6.s}
601 {{objdump -dr got-page-6.d}
602 {readelf -A got-page-6.got}}
603 "got-page-6.so"}
604 {"GOT page 7 (order 1)" "-shared $abi_ldflags(n32) -T got-page-1.ld"
605 "" "$abi_asflags(n32)"
606 {got-page-7a.s got-page-7b.s got-page-7c.s got-page-7d.s
607 got-page-7e.s}
608 {{objdump -dr got-page-7.d}
609 {readelf -A got-page-7.got}}
610 "got-page-7a.so"}
611 {"GOT page 7 (order 2)" "-shared $abi_ldflags(n32) -T got-page-1.ld"
612 "" "$abi_asflags(n32)"
613 {got-page-7e.s got-page-7a.s got-page-7b.s got-page-7c.s
614 got-page-7d.s}
615 {{objdump -dr got-page-7.d}
616 {readelf -A got-page-7.got}}
617 "got-page-7b.so"}
618 }]
619 }
620 run_dump_test "got-dump-1"
621 if $has_newabi {
622 run_dump_test "got-dump-2"
623 }
624 run_dump_test "reloc-estimate-1"
625 }
626
627 if $has_newabi {
628 run_dump_test "emit-relocs-1"
629 }
630
631 run_dump_test "hash1a"
632 run_dump_test "hash1b"
633 run_dump_test "hash1c"
634
635 if {[istarget mips*-*-linux*]} {
636 # The number of symbols that are always included in the symbol table
637 # for these tests. The 4 are:
638 #
639 # the null symbol entry
640 # the .MIPS.stubs section symbol
641 set base_syms 2
642 foreach dynsym { 7fff 8000 fff0 10000 2fe80 } {
643 run_ld_link_tests \
644 [list [list \
645 "Stub for dynsym 0x$dynsym" \
646 "-shared -melf32btsmip -T stub-dynsym-1.ld" "" \
647 [concat \
648 "-EB -march=mips1 -32 -KPIC" \
649 "--defsym base_syms=$base_syms" \
650 "--defsym dynsym=0x$dynsym"] \
651 [list "stub-dynsym-1.s"] \
652 [list [list \
653 "objdump" "-dz" \
654 "stub-dynsym-1-$dynsym.d"]] \
655 "stub-dynsym-1-$dynsym"]]
656 }
657 }
658
659 # For tests which may involve multiple files, use run_ld_link_tests.
660
661 # List contains test-items with 3 items followed by 2 lists:
662 # 0:name 1:ld early options 2:ld late options 3:assembler options
663 # 4:filenames of assembler files 5: action and options. 6: name of output file
664
665 # Actions:
666 # objdump: Apply objdump options on result. Compare with regex (last arg).
667 # nm: Apply nm options on result. Compare with regex (last arg).
668 # readelf: Apply readelf options on result. Compare with regex (last arg).
669
670 set mips_tls_tests {
671 {"Static executable with TLS" "-static -melf32btsmip -T mips-dyn.ld" ""
672 "-EB -march=mips1 -32 -KPIC" {tlsbin-o32.s}
673 {{objdump {-dr -m mips:isa32r2} tlsbin-o32.d} {objdump -srj.got tlsbin-o32.got}}
674 "tls-static-o32"}
675 {"Shared library with TLS" "-shared -melf32btsmip -T mips-lib.ld" ""
676 "-EB -march=mips1 -32 -KPIC" {tlslib-o32.s}
677 {{objdump {-dr -m mips:isa32r2} tlslib-o32.d} {objdump -Rsj.got tlslib-o32.got}}
678 "tlslib-o32.so"}
679 {"Dynamic executable with TLS"
680 "-melf32btsmip -T mips-dyn.ld tmpdir/tlslib-o32.so" ""
681 "-EB -march=mips1 -32 -KPIC" {tlsdyn-o32.s}
682 {{objdump {-dr -m mips:isa32r2} tlsdyn-o32.d} {objdump -Rsj.got tlsdyn-o32.got}}
683 "tls-dynamic-o32"}
684 {"Shared library with multiple GOTs and TLS"
685 "-shared -melf32btsmip -T mips-lib.ld" ""
686 "-EB -march=mips1 -32 -KPIC" {tls-multi-got-1-1.s tls-multi-got-1-2.s}
687 {{readelf {-d -r} tls-multi-got-1.r}
688 {objdump {-dr -m mips:isa32r2} tls-multi-got-1.d}
689 {objdump -Rsj.got tls-multi-got-1.got}}
690 "tlslib-multi.so"}
691 {"Shared library with TLS and versioning"
692 "-shared -melf32btsmip -T mips-lib.ld --version-script tlslib.ver" ""
693 "-EB -march=mips1 -32 -KPIC" {tlslib-o32.s}
694 {{objdump {-dr -m mips:isa32r2} tlslib-o32.d} {objdump -Rsj.got tlslib-o32-ver.got}}
695 "tlslib-o32-ver.so"}
696 {"Dynamic executable with TLS and versioning"
697 "-melf32btsmip -T mips-dyn.ld tmpdir/tlslib-o32-ver.so" ""
698 "-EB -march=mips1 -32 -KPIC" {tlsdyn-o32.s tlsdyn-o32-2.s}
699 {{objdump {-dr -m mips:isa32r2} tlsdyn-o32-1.d} {objdump -Rsj.got tlsdyn-o32-1.got}}
700 "tls-dynamic-o32-ver"}
701 {"Dynamic executable with TLS and versioning (order 2)"
702 "-melf32btsmip -T mips-dyn.ld tmpdir/tlsdyn-o32.o tmpdir/tlslib-o32-ver.so tmpdir/tlsdyn-o32-2.o" ""
703 "-EB -march=mips1 -32 -KPIC" {}
704 {{objdump {-dr -m mips:isa32r2} tlsdyn-o32-2.d} {objdump -Rsj.got tlsdyn-o32-2.got}}
705 "tls-dynamic-o32-ver-2"}
706 {"Dynamic executable with TLS and versioning (order 3)"
707 "-melf32btsmip -T mips-dyn.ld tmpdir/tlsdyn-o32-2.o tmpdir/tlslib-o32-ver.so tmpdir/tlsdyn-o32.o" ""
708 "-EB -march=mips1 -32 -KPIC" {}
709 {{objdump {-dr -m mips:isa32r2} tlsdyn-o32-3.d} {objdump -Rsj.got tlsdyn-o32-3.got}}
710 "tls-dynamic-o32-ver-3"}
711 {"Shared library with TLS and hidden symbols"
712 "-shared -melf32btsmip -T mips-lib.ld --version-script tlslib-hidden.ver" ""
713 "-EB -march=mips1 -32 -KPIC" {tlslib-o32.s}
714 {{objdump {-dr -m mips:isa32r2} tlslib-o32.d} {objdump -Rsj.got tlslib-o32-hidden.got}}
715 "tlslib-o32-hidden.so"}
716 {"Shared library with TLS and hidden symbols (2)"
717 "-shared -melf32btsmip -T mips-lib.ld" ""
718 "-EB -march=mips1 -32 -KPIC" {tls-hidden2a.s tls-hidden2b.s}
719 {{objdump -drj.text tls-hidden2.d} {objdump -sj.got tls-hidden2-got.d}}
720 "tls-hidden2.so"}
721 {"Shared library with TLS and hidden symbols (3)"
722 "-shared -melf32btsmip -T tls-hidden3.ld" ""
723 "-EB -march=mips2 -32 -KPIC" {tls-hidden3a.s tls-hidden3b.s}
724 {{objdump -dj.text tls-hidden3.d} {objdump -sj.got tls-hidden3.got}
725 {readelf --relocs tls-hidden3.r}}
726 "tls-hidden3.so"}
727 {"Shared library with TLS and hidden symbols (4)"
728 "-shared -melf32btsmip -T tls-hidden3.ld" ""
729 "-EB -march=mips2 -32 -KPIC" {tls-hidden4a.s tls-hidden4b.s}
730 {{objdump -sj.got tls-hidden4.got} {readelf --relocs tls-hidden4.r}}
731 "tls-hidden4.so"}
732 }
733
734 if {[istarget mips*-*-linux*]} {
735 run_ld_link_tests $mips_tls_tests
736 }
737
738 set mips16_call_global_test [list \
739 [list "Global calls from mips16" \
740 "$abi_ldflags(o32) -T no-shared-1.ld" "" \
741 "$abi_asflags(o32) -mips32r2" \
742 {mips16-call-global-1.s mips16-call-global-2.s mips16-call-global-3.s} \
743 {{objdump -dr mips16-call-global.d}} \
744 "mips16-call-global"]]
745
746 run_ld_link_tests $mips16_call_global_test
747
748 set mips16_intermix_test [list \
749 [list "Intermixing mips32 and mips16 functions" \
750 "$abi_ldflags(o32)" "" \
751 "$abi_asflags(o32) -mips32r2" \
752 {mips16-intermix-1.s mips16-intermix-2.s} \
753 {{objdump -t mips16-intermix.d}} \
754 "mips16-intermix"]]
755
756 run_ld_link_tests $mips16_intermix_test
757
758 run_dump_test "mips16-local-stubs-1"
759
760 set mips16_fp_stub_test [list \
761 [list "Floating-point stub for mips16 functions" \
762 "$abi_ldflags(o32)" "" \
763 "$abi_asflags(o32) -mips32r2" \
764 {mips16-fp-stub-1.s mips16-fp-stub-2.s} \
765 {{readelf --debug-dump=frames mips16-fp-stub.d}} \
766 "mips16-fp-stub"]]
767
768 run_ld_link_tests $mips16_fp_stub_test
769
770 set o32flagslist [list [list as $abi_asflags(o32)] [list ld $abi_ldflags(o32)]]
771
772 foreach firstfpabi [list 0 1 2 3 4 5 6 7 ] {
773 foreach secondfpabi [list 4 5 6 7 ] {
774 run_dump_test "attr-gnu-4-${firstfpabi}${secondfpabi}" $o32flagslist
775 }
776 }
777 foreach firstfpabi [list 4 5 6 7 ] {
778 foreach secondfpabi [list 0 1 2 3 8 9] {
779 run_dump_test "attr-gnu-4-${firstfpabi}${secondfpabi}" $o32flagslist
780 }
781 }
782 foreach firstfpabi [list 0 1 2 3 ] {
783 foreach secondfpabi [list 0 1 2 3 8 9] {
784 run_dump_test "attr-gnu-4-${firstfpabi}${secondfpabi}"
785 }
786 }
787
788 run_dump_test "attr-gnu-4-81"
789
790 run_dump_test "attr-gnu-8-00"
791 run_dump_test "attr-gnu-8-01"
792 run_dump_test "attr-gnu-8-02"
793 run_dump_test "attr-gnu-8-10"
794 run_dump_test "attr-gnu-8-11"
795 run_dump_test "attr-gnu-8-12"
796 run_dump_test "attr-gnu-8-20"
797 run_dump_test "attr-gnu-8-21"
798 run_dump_test "attr-gnu-8-22"
799
800 run_dump_test "attr-gnu-4-0-ph" $o32flagslist
801 run_dump_test "attr-gnu-4-1-ph" $o32flagslist
802 run_dump_test "attr-gnu-4-2-ph" $o32flagslist
803 run_dump_test "attr-gnu-4-3-ph" $o32flagslist
804 run_dump_test "attr-gnu-4-4-ph" $o32flagslist
805 run_dump_test "attr-gnu-4-5-ph" $o32flagslist
806 run_dump_test "attr-gnu-4-6-ph" $o32flagslist
807 run_dump_test "attr-gnu-4-7-ph" $o32flagslist
808
809 if $has_newabi {
810 run_dump_test "attr-gnu-4-0-n32-ph"
811 run_dump_test "attr-gnu-4-1-n32-ph"
812 run_dump_test "attr-gnu-4-2-n32-ph"
813 run_dump_test "attr-gnu-4-3-n32-ph"
814 run_dump_test "attr-gnu-4-0-n64-ph"
815 run_dump_test "attr-gnu-4-1-n64-ph"
816 run_dump_test "attr-gnu-4-2-n64-ph"
817 run_dump_test "attr-gnu-4-3-n64-ph"
818 }
819
820 run_dump_test "abiflags-strip1-ph" $o32flagslist
821 run_dump_test "abiflags-strip2-ph" $o32flagslist
822 run_dump_test "abiflags-strip3-ph" $o32flagslist
823 run_dump_test "abiflags-strip4-ph" $o32flagslist
824 run_dump_test "abiflags-strip5-ph" $o32flagslist
825 run_dump_test "abiflags-strip6-ph" $o32flagslist
826 run_dump_test "abiflags-strip7-ph" $o32flagslist
827 run_dump_test "abiflags-strip8-ph" $o32flagslist
828 run_dump_test "abiflags-strip9-ph" $o32flagslist
829 run_dump_test "abiflags-strip10-ph" $o32flagslist
830
831 run_dump_test "nan-legacy"
832 run_dump_test "nan-2008"
833 run_dump_test "nan-mixed-1"
834 run_dump_test "nan-mixed-2"
835
836 if { $linux_gnu } {
837 run_ld_link_tests {
838 {"GOT and versioning 1"
839 "-shared -melf32btsmip --version-script got-vers-1.ver" ""
840 "-EB -mips2 -32" {got-vers-1a.s got-vers-1b.s}
841 {{readelf -d got-vers-1.dd}
842 {readelf --symbols got-vers-1.sd}
843 {readelf --relocs got-vers-1.rd}}
844 "got-vers-1.so"}
845 }
846 }
847
848 run_dump_test "undefined"
849
850 # Test the conversion from jr to b
851 if { $linux_gnu } {
852 run_dump_test "jr-to-b-1"
853 run_dump_test "jr-to-b-2"
854 }
855
856 # MIPS16 and microMIPS interlinking test.
857 run_dump_test "mips16-and-micromips"
858
859 # Export class call relocation tests.
860 set abis [concat o32 [expr {$has_newabi ? "n32 n64" : ""}]]
861 foreach { abi } $abis {
862 set loadaddr [string map \
863 {o32 0x12340000 n32 0x12340000 n64 0x123456789abc0000} $abi]
864 set suff [subst \
865 [expr { [istarget *-*-irix*] \
866 ? [string map {o32 o32-irix n32 n32 n64 n64} $abi] \
867 : $abi }]]
868 run_ld_link_tests [list \
869 [list \
870 "MIPS export class call relocation test ($abi)" \
871 "$abi_ldflags($abi) -shared -Ttext $loadaddr -T export-class-call16.ld" "" \
872 "$abi_asflags($abi) -mips3 -KPIC" \
873 [list export-class-call16-${abi}.s export-class-call16-def.s] \
874 [list \
875 "objdump -d export-class-call16-${suff}.dd" \
876 "readelf -A export-class-call16-${abi}.gd"] \
877 "export-class-call16-${abi}.so"]]
878 }
879
880 # Magic __ehdr_start symbol tests.
881 set abis [concat o32 [expr {$has_newabi ? "n32 n64" : ""}]]
882 foreach { abi } $abis {
883 set suff [string map {o32 o32 n32 new n64 new} $abi]
884 run_ld_link_tests [list \
885 [list \
886 "MIPS magic __ehdr_start symbol test 1 ($abi)" \
887 "$abi_ldflags($abi) -T ehdr_start-1.ld" "" \
888 "$abi_asflags($abi)" \
889 [list ehdr_start-${suff}.s] \
890 [list "readelf -s ehdr_start-1.nd"] \
891 "ehdr_start-1-${abi}"]]
892 if [regexp "(?:n32|n64)" "$abi"] {
893 setup_kfail "mips*-*-*" "ld/15428"
894 }
895 run_ld_link_tests [list \
896 [list \
897 "MIPS magic __ehdr_start symbol test 2 ($abi)" \
898 "$abi_ldflags($abi) -T ehdr_start-2.ld" "" \
899 "$abi_asflags($abi)" \
900 [list ehdr_start-${suff}.s] \
901 [list "readelf -s ehdr_start-2.nd"] \
902 "ehdr_start-2-${abi}"]]
903 }
904
905 # R_MIPS_JALR reloc tests.
906 set abis [concat o32 [expr {$has_newabi ? "n32 n64" : ""}]]
907 foreach { abi } $abis {
908 run_ld_link_tests [list \
909 [list \
910 "MIPS JALR reloc test ($abi)" \
911 "$abi_ldflags($abi) -T jalr3.ld" "" \
912 "$abi_asflags($abi)" \
913 [list ../../../gas/testsuite/gas/mips/jalr3.s] \
914 [list "objdump -d jalr3.dd"] \
915 "jalr3-${abi}"]]
916 }
917
918 proc build_mips_plt_lib { abi } {
919 global abi_asflags
920 global abi_ldflags
921
922 run_ld_link_tests [list \
923 [list "Shared $abi library for compressed PLT tests" \
924 "-shared $abi_ldflags($abi)" "" \
925 "$abi_asflags($abi)" \
926 { compressed-plt-1-dyn.s } \
927 {} \
928 "compressed-plt-1-${abi}-dyn.so"]]
929 }
930
931 proc run_mips_plt_test { name abi filter micromips suffix {extra {}} } {
932 global abi_asflags
933 global abi_ldflags
934
935 set as_flags "$abi_asflags($abi) --defsym filter=$filter"
936 append as_flags " --defsym micromips=$micromips --defsym $abi=1"
937 if {[string equal $abi o32]} {
938 append as_flags " -march=mips2"
939 }
940 set ld_flags "$abi_ldflags($abi) -T compressed-plt-1.ld"
941 set dynobj "tmpdir/compressed-plt-1-${abi}-dyn.so"
942 set files [list]
943 if { $filter & 3 } {
944 lappend files compressed-plt-1a.s
945 }
946 if { $filter & 12 } {
947 lappend files compressed-plt-1b.s
948 }
949 if { $filter & 16 } {
950 lappend files compressed-plt-1c.s
951 }
952 eval [list lappend files] $extra
953 set readelf_flags "-A --syms --relocs -d"
954 if { [string match "*word*" $suffix] } {
955 append readelf_flags " -x.data"
956 }
957 set objdump_flags "-d -Mgpr-names=numeric"
958 set basename "compressed-plt-1-${abi}-${suffix}"
959 run_ld_link_tests [list \
960 [list "$name" $ld_flags $dynobj \
961 "$as_flags" $files \
962 [list [list readelf $readelf_flags ${basename}.rd] \
963 [list objdump $objdump_flags ${basename}.od]] \
964 $basename]]
965 }
966
967 if { $linux_gnu } {
968 build_mips_plt_lib o32
969 run_mips_plt_test "o32 PLTs for standard encoding" o32 28 0 se
970 run_mips_plt_test "o32 PLTs for MIPS16 encoding" o32 19 0 mips16-only
971 run_mips_plt_test "o32 PLTs for microMIPS encoding" o32 19 1 umips-only
972 run_mips_plt_test "o32 PLTs for mixed MIPS and MIPS16" \
973 o32 -1 0 mips16
974 run_mips_plt_test "o32 PLTs for mixed MIPS and MIPS16 with %got" \
975 o32 -1 0 mips16-got compressed-plt-1d.s
976 run_mips_plt_test "o32 PLTs for mixed MIPS and MIPS16 with .word" \
977 o32 -1 0 mips16-word compressed-plt-1e.s
978 run_mips_plt_test "o32 PLTs for mixed MIPS and microMIPS" \
979 o32 -1 1 umips
980 run_mips_plt_test "o32 PLTs for mixed MIPS and microMIPS with %got" \
981 o32 -1 1 umips-got compressed-plt-1d.s
982 run_mips_plt_test "o32 PLTs for mixed MIPS and microMIPS with .word" \
983 o32 -1 1 umips-word compressed-plt-1e.s
984
985 if $has_newabi {
986 build_mips_plt_lib n32
987 run_mips_plt_test "n32 PLTs for mixed MIPS and MIPS16" \
988 n32 -1 0 mips16
989 run_mips_plt_test "n32 PLTs for mixed MIPS and microMIPS" \
990 n32 -1 1 umips
991 }
992 }
993
994 # PR ld/19908 export class tests.
995 if { $linux_gnu } {
996 run_ld_link_tests [list \
997 [list "Shared library for MIPS export class symbol reference tests" \
998 "$abi_ldflags(o32) -shared" "" \
999 "$abi_asflags(o32)" \
1000 { export-class-ref-f2.s } \
1001 { { readelf --dyn-syms export-class-ref-lib.sd } } \
1002 "export-class-ref-lib.so"]]
1003 foreach { class flag } { internal 1 hidden 2 protected 3 } {
1004 run_ld_link_tests [list \
1005 [list "MIPS $class symbol reference test 1" \
1006 "$abi_ldflags(o32) -e f0" "tmpdir/export-class-ref-lib.so" \
1007 "$abi_asflags(o32) --defsym defv=$flag" \
1008 { export-class-ref-f0.s export-class-ref-f1.s } \
1009 [list [list readelf --dyn-syms export-$class-ref.sd] \
1010 [list readelf --dyn-syms export-local-ref.sd]] \
1011 "export-$class-ref"] \
1012 [list "MIPS $class symbol reference test 2" \
1013 "$abi_ldflags(o32) -e f0" "tmpdir/export-class-ref-lib.so" \
1014 "$abi_asflags(o32) --defsym defv=$flag --defsym refv=$flag" \
1015 { export-class-ref-f0.s export-class-ref-f1.s } \
1016 [list [list readelf --dyn-syms export-$class-ref.sd] \
1017 [list readelf --dyn-syms export-local-ref.sd]] \
1018 "export-$class-ref"]]
1019 }
1020 }
This page took 0.052551 seconds and 4 git commands to generate.