Commit | Line | Data |
---|---|---|
a657e7c1 | 1 | # Expect script for MIPS ELF linker tests |
aa820537 AM |
2 | # Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 |
3 | # Free Software Foundation, Inc. | |
a657e7c1 | 4 | # |
f96b4a7b NC |
5 | # This file is part of the GNU Binutils. |
6 | # | |
7 | # This program is free software; you can redistribute it and/or modify | |
a657e7c1 | 8 | # it under the terms of the GNU General Public License as published by |
f96b4a7b | 9 | # the Free Software Foundation; either version 3 of the License, or |
a657e7c1 CD |
10 | # (at your option) any later version. |
11 | # | |
12 | # This program is distributed in the hope that it will be useful, | |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | # GNU General Public License for more details. | |
16 | # | |
17 | # You should have received a copy of the GNU General Public License | |
18 | # along with this program; if not, write to the Free Software | |
f96b4a7b NC |
19 | # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, |
20 | # MA 02110-1301, USA. | |
a657e7c1 CD |
21 | # |
22 | ||
0a44bf69 RS |
23 | if {[istarget "mips*-*-vxworks"]} { |
24 | set mipsvxtests { | |
25 | {"VxWorks shared library test 1" "-shared -Tvxworks1.ld" | |
26 | "-mips2" {vxworks1-lib.s} | |
27 | {{readelf --relocs vxworks1-lib.rd} {objdump -dr vxworks1-lib.dd} | |
9e3313ae | 28 | {readelf --symbols vxworks1-lib.nd} {readelf -d vxworks1-lib.td}} |
0a44bf69 RS |
29 | "libvxworks1.so"} |
30 | {"VxWorks executable test 1 (dynamic)" \ | |
31 | "tmpdir/libvxworks1.so -Tvxworks1.ld -q --force-dynamic" | |
32 | "-mips2" {vxworks1.s} | |
33 | {{readelf --relocs vxworks1.rd} {objdump -dr vxworks1.dd}} | |
34 | "vxworks1"} | |
35 | {"VxWorks executable test 2 (dynamic)" \ | |
36 | "-Tvxworks1.ld -q --force-dynamic" | |
37 | "-mips2" {vxworks2.s} | |
38 | {{readelf --segments vxworks2.sd}} | |
39 | "vxworks2"} | |
40 | {"VxWorks executable test 2 (static)" | |
41 | "-Tvxworks1.ld" | |
42 | "-mips2" {vxworks2.s} | |
43 | {{readelf --segments vxworks2-static.sd}} | |
44 | "vxworks2"} | |
45 | } | |
46 | run_ld_link_tests $mipsvxtests | |
47 | run_dump_test "vxworks1-static" | |
8275b357 | 48 | run_dump_test "vxworks-forced-local-1" |
0a44bf69 RS |
49 | return |
50 | } | |
51 | ||
fbf18a5c TS |
52 | if {![istarget mips*-*-*] || ![is_elf_format]} { |
53 | return | |
54 | } | |
30a2f863 | 55 | |
fbf18a5c TS |
56 | set has_newabi [expr [istarget *-*-irix6*] || [istarget mips64*-*-linux*]] |
57 | set linux_gnu [expr [istarget mips*-*-linux*]] | |
58 | set embedded_elf [expr [istarget mips*-*-elf]] | |
30a2f863 | 59 | |
738e5348 RS |
60 | if { $linux_gnu } { |
61 | run_ld_link_tests [list \ | |
62 | [list "Dummy shared library for MIPS16 PIC test 1" \ | |
63 | "-shared -melf32btsmip" \ | |
3c0bfb2a RS |
64 | "-EB -32 -mips1" \ |
65 | { mips16-pic-1-dummy.s } \ | |
738e5348 RS |
66 | {} \ |
67 | "mips16-pic-1-dummy.so"] \ | |
68 | [list "MIPS16 PIC test 1" \ | |
69 | "-melf32btsmip -T mips16-pic-1.ld tmpdir/mips16-pic-1-dummy.so" \ | |
3c0bfb2a RS |
70 | "-EB -32 -mips1 -I $srcdir/$subdir" \ |
71 | { mips16-pic-1a.s mips16-pic-1b.s } \ | |
738e5348 RS |
72 | { { objdump { -dr -j.text } mips16-pic-1.dd } |
73 | { readelf -A mips16-pic-1.gd } } \ | |
74 | "mips16-pic-1"] \ | |
75 | [list "MIPS16 PIC test 2" \ | |
76 | "-melf32btsmip -T mips16-pic-1.ld -shared" \ | |
3c0bfb2a RS |
77 | "-EB -32 -mips1 -I $srcdir/$subdir" \ |
78 | { mips16-pic-2a.s mips16-pic-2b.s } \ | |
738e5348 RS |
79 | { { objdump { -dr -j.text } mips16-pic-2.dd } \ |
80 | { readelf -A mips16-pic-2.gd } \ | |
81 | { readelf --symbols mips16-pic-2.nd } \ | |
82 | { readelf --relocs mips16-pic-2.rd } \ | |
83 | { readelf -d mips16-pic-2.ad } } \ | |
861fb55a DJ |
84 | "mips16-pic-2"] \ |
85 | [list "MIPS16 PIC test 3" \ | |
86 | "-melf32btsmip -T mips16-pic-1.ld tmpdir/mips16-pic-1-dummy.so" \ | |
3c0bfb2a RS |
87 | "-EB -32 -mips1 -I $srcdir/$subdir" \ |
88 | { mips16-pic-3a.s mips16-pic-3b.s } \ | |
861fb55a DJ |
89 | { { objdump -dr mips16-pic-3.dd } \ |
90 | { readelf --relocs mips16-pic-3.rd } \ | |
91 | { readelf -A mips16-pic-3.gd } } \ | |
61b0a4af RS |
92 | "mips16-pic-3"] \ |
93 | [list "MIPS16 PIC test 4 (shared library)" \ | |
94 | "-shared -melf32btsmip -T mips16-pic-1.ld --version-script mips16-pic-4.ver" \ | |
3c0bfb2a RS |
95 | "-EB -32 -mips1" \ |
96 | { mips16-pic-4a.s mips16-pic-4b.s } \ | |
61b0a4af RS |
97 | { { objdump -dr mips16-pic-4a.dd } \ |
98 | { readelf --symbols mips16-pic-4a.nd } \ | |
99 | { readelf -A mips16-pic-4a.gd } } \ | |
100 | "mips16-pic-4.so"] \ | |
101 | [list "MIPS16 PIC test 4 (executable)" \ | |
102 | "-melf32btsmip -T mips16-pic-1.ld tmpdir/mips16-pic-4.so" \ | |
3c0bfb2a RS |
103 | "-EB -32 -mips1" \ |
104 | { mips16-pic-4c.s } \ | |
61b0a4af RS |
105 | { { objdump -dr mips16-pic-4b.dd } } \ |
106 | "mips16-pic-4"]] | |
738e5348 RS |
107 | } |
108 | ||
08e8dfaf RS |
109 | if { [istarget mips64*-linux-gnu] } { |
110 | set o32_as_flags "-32 -EB" | |
111 | set o32_ld_flags "-melf32btsmip" | |
112 | } else { | |
113 | set o32_as_flags "" | |
114 | set o32_ld_flags "" | |
115 | } | |
30a2f863 | 116 | |
fbf18a5c TS |
117 | # Check MIPS16 markings being passed through link. |
118 | run_dump_test "mips16-1" | |
8914585c | 119 | |
fbf18a5c TS |
120 | # MIPS branch offset final link checking. |
121 | run_dump_test "branch-misc-1" | |
7d6c7577 | 122 | |
732be173 DJ |
123 | # Test multi-got link. We only do this on GNU/Linux because it requires |
124 | # the "traditional" emulations. | |
125 | if { $linux_gnu } { | |
126 | run_dump_test "multi-got-1" | |
bbe506e8 | 127 | run_dump_test "multi-got-no-shared" |
2152e047 DJ |
128 | run_dump_test "multi-got-hidden-1" |
129 | run_dump_test "multi-got-hidden-2" | |
732be173 | 130 | } |
30a2f863 | 131 | |
0a61c8c2 RS |
132 | # Test __gnu_local_gp accesses |
133 | if { $linux_gnu } { | |
134 | run_dump_test "no-shared-1-o32" | |
135 | if { $has_newabi } { | |
136 | run_dump_test "no-shared-1-n32" | |
137 | run_dump_test "no-shared-1-n64" | |
138 | } | |
139 | } | |
140 | ||
fbf18a5c TS |
141 | if $has_newabi { |
142 | run_dump_test "elf-rel-got-n32" | |
143 | run_dump_test "elf-rel-xgot-n32" | |
48fe7bda | 144 | if { $linux_gnu } { |
fbf18a5c TS |
145 | run_dump_test "elf-rel-got-n64-linux" |
146 | run_dump_test "elf-rel-xgot-n64-linux" | |
147 | } else { | |
148 | run_dump_test "elf-rel-got-n64" | |
149 | run_dump_test "elf-rel-xgot-n64" | |
48fe7bda AO |
150 | } |
151 | ||
fbf18a5c TS |
152 | run_dump_test "relax-jalr-n32" |
153 | run_dump_test "relax-jalr-n32-shared" | |
154 | run_dump_test "relax-jalr-n64" | |
155 | run_dump_test "relax-jalr-n64-shared" | |
156 | } | |
48fe7bda | 157 | |
fbf18a5c TS |
158 | if { $linux_gnu } { |
159 | run_dump_test "rel32-o32" | |
160 | run_dump_test "rel32-n32" | |
161 | run_dump_test "rel64" | |
861fb55a DJ |
162 | # The first test checks that a mixed PIC/non-PIC relocatable link |
163 | # will not introduce any stubs itself, but will flag PIC functions | |
164 | # for the final link. | |
165 | # | |
166 | # The second test checks that we insert stubs for calls from | |
167 | # non-PIC functions to PIC functions when linking the original | |
168 | # two objects together. | |
169 | # | |
170 | # The third test checks that we do the same when linking the | |
171 | # result of the first link (with no other source files). | |
172 | run_ld_link_tests { | |
173 | {"PIC and non-PIC test 1 (relocatable)" "-r -melf32btsmip" | |
174 | "-32 -EB -mips2" {pic-and-nonpic-1a.s pic-and-nonpic-1b.s} | |
175 | {{objdump -dr pic-and-nonpic-1-rel.dd} | |
176 | {readelf --symbols pic-and-nonpic-1-rel.nd}} | |
177 | "pic-and-nonpic-1-rel.o"} | |
178 | {"PIC and non-PIC test 1 (static 1)" | |
179 | "-melf32btsmip -Tpic-and-nonpic-1.ld" | |
180 | "-32 -EB -mips2" {pic-and-nonpic-1a.s pic-and-nonpic-1b.s} | |
181 | {{objdump -dr pic-and-nonpic-1.dd} | |
182 | {readelf --symbols pic-and-nonpic-1.nd}} | |
183 | "pic-and-nonpic-1-static1.o"} | |
184 | {"PIC and non-PIC test 1 (static 2)" | |
185 | "-melf32btsmip -Tpic-and-nonpic-1.ld tmpdir/pic-and-nonpic-1-rel.o" | |
186 | "" {} | |
187 | {{objdump -dr pic-and-nonpic-1.dd} | |
188 | {readelf --symbols pic-and-nonpic-1.nd}} | |
189 | "pic-and-nonpic-1-static2.o"} | |
190 | } | |
191 | run_dump_test "pic-and-nonpic-2" | |
192 | run_ld_link_tests { | |
193 | {"PIC and non-PIC test 3 (shared library)" | |
194 | "-melf32btsmip -shared -Tpic-and-nonpic-3a.ld" | |
195 | "-32 -EB -mips2" {pic-and-nonpic-3a.s} | |
196 | {{readelf --segments pic-and-nonpic-3a.sd} | |
197 | {readelf -A pic-and-nonpic-3a.gd} | |
198 | {objdump -dr pic-and-nonpic-3a.dd}} | |
199 | "pic-and-nonpic-3a.so"} | |
200 | {"PIC and non-PIC test 3 (executable)" | |
201 | "-melf32btsmip -Tpic-and-nonpic-3b.ld tmpdir/pic-and-nonpic-3a.so" | |
202 | "-32 -EB -mips2" {pic-and-nonpic-3b.s} | |
203 | {{readelf --segments pic-and-nonpic-3b.sd} | |
204 | {objdump -dr pic-and-nonpic-3b.dd} | |
205 | {objdump {-s -j.got.plt} pic-and-nonpic-3b.pd} | |
206 | {readelf -A pic-and-nonpic-3b.gd} | |
207 | {readelf --relocs pic-and-nonpic-3b.rd} | |
208 | {readelf --symbols pic-and-nonpic-3b.nd} | |
209 | {readelf -d pic-and-nonpic-3b.ad}} | |
210 | "pic-and-nonpic-3b"} | |
211 | } | |
212 | run_dump_test "pic-and-nonpic-3-error" | |
213 | run_ld_link_tests { | |
214 | {"PIC and non-PIC test 4 (shared library)" | |
215 | "-melf32btsmip -shared -Tpic-and-nonpic-3a.ld" | |
216 | "-32 -EB -mips2" {pic-and-nonpic-4a.s} | |
217 | {} | |
218 | "pic-and-nonpic-4a.so"} | |
219 | {"PIC and non-PIC test 4 (executable)" | |
220 | "-melf32btsmip -Tpic-and-nonpic-4b.ld tmpdir/pic-and-nonpic-4a.so" | |
221 | "-32 -EB -mips2" {pic-and-nonpic-4b.s} | |
222 | {{readelf --segments pic-and-nonpic-4b.sd} | |
223 | {objdump -dr pic-and-nonpic-4b.dd} | |
224 | {objdump {-s -j.got -j.data} pic-and-nonpic-4b.gd} | |
225 | {readelf --relocs pic-and-nonpic-4b.rd} | |
226 | {readelf --symbols pic-and-nonpic-4b.nd} | |
227 | {readelf -d pic-and-nonpic-4b.ad}} | |
228 | "pic-and-nonpic-4b"} | |
229 | } | |
230 | run_dump_test "pic-and-nonpic-4-error" | |
231 | run_ld_link_tests { | |
232 | {"PIC and non-PIC test 5 (executable)" | |
233 | "-melf32btsmip -Tpic-and-nonpic-5b.ld tmpdir/pic-and-nonpic-3a.so tmpdir/pic-and-nonpic-4a.so" | |
234 | "-32 -EB -mips2" {pic-and-nonpic-5a.s pic-and-nonpic-5b.s} | |
235 | {{readelf --segments pic-and-nonpic-5b.sd} | |
236 | {objdump -dr pic-and-nonpic-5b.dd} | |
237 | {objdump {-s -j.got.plt -j.data} pic-and-nonpic-5b.pd} | |
238 | {readelf -A pic-and-nonpic-5b.gd} | |
239 | {readelf --relocs pic-and-nonpic-5b.rd} | |
240 | {readelf --symbols pic-and-nonpic-5b.nd} | |
241 | {readelf -d pic-and-nonpic-5b.ad}} | |
242 | "pic-and-nonpic-5b"} | |
243 | } | |
244 | set abis { o32 -32 elf32btsmip } | |
245 | if $has_newabi { | |
246 | lappend abis n32 -n32 elf32btsmipn32 | |
247 | lappend abis n64 -64 elf64btsmip | |
248 | } | |
249 | foreach { abi flag emul } $abis { | |
250 | run_ld_link_tests [list \ | |
251 | [list "PIC and non-PIC test 6 ($abi shared library)" \ | |
252 | "-m$emul -shared -Tpic-and-nonpic-3a.ld" \ | |
253 | "$flag -EB -mips3" \ | |
254 | [list "pic-and-nonpic-6-${abi}a.s"] {} \ | |
255 | "pic-and-nonpic-6-${abi}.so"] \ | |
256 | [list "PIC and non-PIC test 6 ($abi executable)" \ | |
257 | "-m$emul -Tpic-and-nonpic-6.ld tmpdir/pic-and-nonpic-6-${abi}.so" \ | |
258 | "$flag -EB -mips3" \ | |
259 | [list "pic-and-nonpic-6-${abi}b.s" \ | |
260 | "pic-and-nonpic-6-${abi}c.s"] \ | |
261 | [list "readelf {--wide --segments} pic-and-nonpic-6-${abi}.sd" \ | |
262 | "objdump -dr pic-and-nonpic-6-${abi}.dd" \ | |
263 | "objdump {-s -j.got.plt} pic-and-nonpic-6-${abi}.pd" \ | |
264 | "readelf -A pic-and-nonpic-6-${abi}.gd" \ | |
265 | "readelf --relocs pic-and-nonpic-6-${abi}.rd" \ | |
266 | "readelf --symbols pic-and-nonpic-6-${abi}.nd" \ | |
267 | "readelf -d pic-and-nonpic-6-${abi}.ad"] \ | |
268 | "pic-and-nonpic-6-${abi}"]] | |
269 | } | |
fbf18a5c | 270 | } |
a657e7c1 | 271 | |
fbf18a5c | 272 | if { $embedded_elf } { |
fbf18a5c | 273 | run_dump_test "region1" |
a657e7c1 | 274 | } |
18ab1921 RS |
275 | |
276 | if $embedded_elf { | |
277 | # This could work on other targets too, but would need the appropriate | |
278 | # ld -m switch. | |
279 | run_dump_test "reloc-1-rel" | |
280 | } | |
281 | if $has_newabi { | |
282 | run_dump_test "reloc-1-n32" | |
283 | if $linux_gnu { | |
284 | # Uses a linux-specific ld -m switch | |
285 | run_dump_test "reloc-1-n64" | |
286 | } | |
287 | } | |
288 | run_dump_test "reloc-2" | |
17a6716a | 289 | run_dump_test "reloc-merge-lo16" |
3b788261 TS |
290 | run_dump_test "reloc-3" |
291 | if {$has_newabi} { | |
292 | run_dump_test "reloc-3-n32" | |
293 | } | |
43ec5bc0 AN |
294 | run_dump_test "reloc-4" |
295 | run_dump_test "reloc-5" | |
296 | ||
353057a5 RS |
297 | if {$has_newabi && $linux_gnu} { |
298 | run_dump_test "eh-frame1-n32" | |
299 | run_dump_test "eh-frame1-n64" | |
dcf507a6 RS |
300 | run_dump_test "eh-frame2-n32" |
301 | run_dump_test "eh-frame2-n64" | |
353057a5 | 302 | } |
8c946ed5 RS |
303 | if {$embedded_elf} { |
304 | run_dump_test "eh-frame3" | |
305 | run_dump_test "eh-frame4" | |
306 | } | |
18e04883 RS |
307 | if {$linux_gnu} { |
308 | set eh_frame5_test { | |
309 | {"MIPS eh-frame 5" | |
310 | "-melf32btsmip -shared -Teh-frame5.ld" | |
311 | "-32 -EB" | |
312 | {eh-frame5.s} | |
313 | {{readelf {--relocs -wf} eh-frame5.d}} | |
314 | "eh-frame5.so"} | |
315 | } | |
316 | run_ld_link_tests $eh_frame5_test | |
317 | } | |
0efd4160 ILT |
318 | |
319 | run_dump_test "jaloverflow" | |
c314987d | 320 | run_dump_test "jaloverflow-2" |
1f0f3e9b RS |
321 | if {$has_newabi} { |
322 | run_dump_test "jalbal" | |
323 | } | |
d6f16593 MR |
324 | |
325 | run_dump_test "mips16-hilo" | |
326 | if {$has_newabi} { | |
327 | run_dump_test "mips16-hilo-n32" | |
328 | } | |
f4e584bd | 329 | |
cc27e1dc EC |
330 | if { $linux_gnu } { |
331 | run_dump_test "textrel-1" | |
c224138d RS |
332 | run_dump_test "got-page-1" |
333 | if $has_newabi { | |
334 | run_dump_test "got-page-2" | |
08b55522 | 335 | run_dump_test "dyn-sec64" |
c224138d RS |
336 | } |
337 | run_dump_test "got-page-3" | |
ccb4c951 RS |
338 | run_dump_test "got-dump-1" |
339 | if $has_newabi { | |
340 | run_dump_test "got-dump-2" | |
341 | } | |
63897e2c | 342 | run_dump_test "reloc-estimate-1" |
cc27e1dc EC |
343 | } |
344 | ||
81d43bff RS |
345 | if $has_newabi { |
346 | run_dump_test "emit-relocs-1" | |
347 | } | |
348 | ||
73934d31 RS |
349 | run_dump_test "hash1a" |
350 | run_dump_test "hash1b" | |
351 | run_dump_test "hash1c" | |
352 | ||
5108fc1b RS |
353 | if {[istarget mips*-*-linux*]} { |
354 | # The number of symbols that are always included in the symbol table | |
74541ad4 | 355 | # for these tests. The 4 are: |
5108fc1b RS |
356 | # |
357 | # the null symbol entry | |
358 | # the .MIPS.stubs section symbol | |
5108fc1b RS |
359 | # _gp |
360 | # _GLOBAL_OFFSET_TABLE_ | |
74541ad4 | 361 | set base_syms 4 |
5108fc1b RS |
362 | foreach dynsym { 7fff 8000 fff0 10000 2fe80 } { |
363 | run_ld_link_tests \ | |
364 | [list [list \ | |
365 | "Stub for dynsym 0x$dynsym" \ | |
366 | "-shared -melf32btsmip -T stub-dynsym-1.ld" \ | |
367 | [concat \ | |
368 | "-EB -march=mips1 -32 -KPIC" \ | |
369 | "--defsym base_syms=$base_syms" \ | |
370 | "--defsym dynsym=0x$dynsym"] \ | |
371 | [list "stub-dynsym-1.s"] \ | |
372 | [list [list \ | |
373 | "objdump" "-dz" \ | |
374 | "stub-dynsym-1-$dynsym.d"]] \ | |
375 | "stub-dynsym-1-$dynsym"]] | |
376 | } | |
377 | } | |
378 | ||
f4e584bd DJ |
379 | # For tests which may involve multiple files, use run_ld_link_tests. |
380 | ||
381 | # List contains test-items with 3 items followed by 2 lists: | |
382 | # 0:name 1:ld options 2:assembler options | |
383 | # 3:filenames of assembler files 4: action and options. 5: name of output file | |
384 | ||
385 | # Actions: | |
386 | # objdump: Apply objdump options on result. Compare with regex (last arg). | |
387 | # nm: Apply nm options on result. Compare with regex (last arg). | |
388 | # readelf: Apply readelf options on result. Compare with regex (last arg). | |
389 | ||
390 | set mips_tls_tests { | |
391 | {"Static executable with TLS" "-static -melf32btsmip -T mips-dyn.ld" | |
392 | "-EB -march=mips1 -32 -KPIC" {tlsbin-o32.s} | |
393 | {{objdump {-dr -m mips:isa32r2} tlsbin-o32.d} {objdump -srj.got tlsbin-o32.got}} | |
394 | "tls-static-o32"} | |
395 | {"Shared library with TLS" "-shared -melf32btsmip -T mips-lib.ld" | |
396 | "-EB -march=mips1 -32 -KPIC" {tlslib-o32.s} | |
397 | {{objdump {-dr -m mips:isa32r2} tlslib-o32.d} {objdump -Rsj.got tlslib-o32.got}} | |
398 | "tlslib-o32.so"} | |
399 | {"Dynamic executable with TLS" | |
400 | "-melf32btsmip -T mips-dyn.ld tmpdir/tlslib-o32.so" | |
401 | "-EB -march=mips1 -32 -KPIC" {tlsdyn-o32.s} | |
402 | {{objdump {-dr -m mips:isa32r2} tlsdyn-o32.d} {objdump -Rsj.got tlsdyn-o32.got}} | |
403 | "tls-dynamic-o32"} | |
404 | {"Shared library with multiple GOTs and TLS" | |
405 | "-shared -melf32btsmip -T mips-lib.ld" | |
406 | "-EB -march=mips1 -32 -KPIC" {tls-multi-got-1-1.s tls-multi-got-1-2.s} | |
407 | {{readelf {-d -r} tls-multi-got-1.r} | |
408 | {objdump {-dr -m mips:isa32r2} tls-multi-got-1.d} | |
409 | {objdump -Rsj.got tls-multi-got-1.got}} | |
410 | "tlslib-multi.so"} | |
411 | {"Shared library with TLS and versioning" | |
412 | "-shared -melf32btsmip -T mips-lib.ld --version-script tlslib.ver" | |
413 | "-EB -march=mips1 -32 -KPIC" {tlslib-o32.s} | |
414 | {{objdump {-dr -m mips:isa32r2} tlslib-o32.d} {objdump -Rsj.got tlslib-o32-ver.got}} | |
415 | "tlslib-o32-ver.so"} | |
416 | {"Dynamic executable with TLS and versioning" | |
417 | "-melf32btsmip -T mips-dyn.ld tmpdir/tlslib-o32-ver.so" | |
418 | "-EB -march=mips1 -32 -KPIC" {tlsdyn-o32.s tlsdyn-o32-2.s} | |
419 | {{objdump {-dr -m mips:isa32r2} tlsdyn-o32-1.d} {objdump -Rsj.got tlsdyn-o32-1.got}} | |
420 | "tls-dynamic-o32-ver"} | |
421 | {"Dynamic executable with TLS and versioning (order 2)" | |
422 | "-melf32btsmip -T mips-dyn.ld tmpdir/tlsdyn-o32.o tmpdir/tlslib-o32-ver.so tmpdir/tlsdyn-o32-2.o" | |
423 | "-EB -march=mips1 -32 -KPIC" {} | |
424 | {{objdump {-dr -m mips:isa32r2} tlsdyn-o32-2.d} {objdump -Rsj.got tlsdyn-o32-2.got}} | |
425 | "tls-dynamic-o32-ver-2"} | |
426 | {"Dynamic executable with TLS and versioning (order 3)" | |
427 | "-melf32btsmip -T mips-dyn.ld tmpdir/tlsdyn-o32-2.o tmpdir/tlslib-o32-ver.so tmpdir/tlsdyn-o32.o" | |
428 | "-EB -march=mips1 -32 -KPIC" {} | |
429 | {{objdump {-dr -m mips:isa32r2} tlsdyn-o32-3.d} {objdump -Rsj.got tlsdyn-o32-3.got}} | |
430 | "tls-dynamic-o32-ver-3"} | |
431 | {"Shared library with TLS and hidden symbols" | |
432 | "-shared -melf32btsmip -T mips-lib.ld --version-script tlslib-hidden.ver" | |
433 | "-EB -march=mips1 -32 -KPIC" {tlslib-o32.s} | |
434 | {{objdump {-dr -m mips:isa32r2} tlslib-o32.d} {objdump -Rsj.got tlslib-o32-hidden.got}} | |
435 | "tlslib-o32-hidden.so"} | |
4005427f RS |
436 | {"Shared library with TLS and hidden symbols (2)" |
437 | "-shared -melf32btsmip -T mips-lib.ld" | |
438 | "-EB -march=mips1 -32 -KPIC" {tls-hidden2a.s tls-hidden2b.s} | |
439 | {{objdump -drj.text tls-hidden2.d} {objdump -sj.got tls-hidden2-got.d}} | |
440 | "tls-hidden2.so"} | |
ead49a57 RS |
441 | {"Shared library with TLS and hidden symbols (3)" |
442 | "-shared -melf32btsmip -T tls-hidden3.ld" | |
443 | "-EB -march=mips2 -32 -KPIC" {tls-hidden3a.s tls-hidden3b.s} | |
444 | {{objdump -dj.text tls-hidden3.d} {objdump -sj.got tls-hidden3.got} | |
445 | {readelf --relocs tls-hidden3.r}} | |
446 | "tls-hidden3.so"} | |
447 | {"Shared library with TLS and hidden symbols (4)" | |
448 | "-shared -melf32btsmip -T tls-hidden3.ld" | |
449 | "-EB -march=mips2 -32 -KPIC" {tls-hidden4a.s tls-hidden4b.s} | |
450 | {{objdump -sj.got tls-hidden4.got} {readelf --relocs tls-hidden4.r}} | |
451 | "tls-hidden4.so"} | |
f4e584bd DJ |
452 | } |
453 | ||
454 | if {[istarget mips*-*-linux*]} { | |
455 | run_ld_link_tests $mips_tls_tests | |
456 | } | |
457 | ||
08e8dfaf RS |
458 | set mips16_call_global_test [list \ |
459 | [list "Global calls from mips16" \ | |
460 | "$o32_ld_flags" \ | |
461 | "$o32_as_flags -mips32r2" \ | |
462 | {mips16-call-global-1.s mips16-call-global-2.s mips16-call-global-3.s} \ | |
463 | {{objdump -dr mips16-call-global.d}} \ | |
464 | "mips16-call-global"]] | |
35d3d567 TS |
465 | |
466 | run_ld_link_tests $mips16_call_global_test | |
b9d58d71 | 467 | |
08e8dfaf RS |
468 | set mips16_intermix_test [list \ |
469 | [list "Intermixing mips32 and mips16 functions" \ | |
470 | "$o32_ld_flags" \ | |
471 | "$o32_as_flags -mips32r2" \ | |
472 | {mips16-intermix-1.s mips16-intermix-2.s} \ | |
473 | {{objdump -t mips16-intermix.d}} \ | |
474 | "mips16-intermix"]] | |
b9d58d71 TS |
475 | |
476 | run_ld_link_tests $mips16_intermix_test | |
b314ec0e RS |
477 | |
478 | run_dump_test "mips16-local-stubs-1" | |
2cf19d5c JM |
479 | |
480 | run_dump_test "attr-gnu-4-00" | |
481 | run_dump_test "attr-gnu-4-01" | |
482 | run_dump_test "attr-gnu-4-02" | |
483 | run_dump_test "attr-gnu-4-03" | |
42554f6a TS |
484 | run_dump_test "attr-gnu-4-04" |
485 | run_dump_test "attr-gnu-4-05" | |
2cf19d5c JM |
486 | run_dump_test "attr-gnu-4-10" |
487 | run_dump_test "attr-gnu-4-11" | |
488 | run_dump_test "attr-gnu-4-12" | |
489 | run_dump_test "attr-gnu-4-13" | |
490 | run_dump_test "attr-gnu-4-14" | |
42554f6a | 491 | run_dump_test "attr-gnu-4-15" |
2cf19d5c JM |
492 | run_dump_test "attr-gnu-4-20" |
493 | run_dump_test "attr-gnu-4-21" | |
494 | run_dump_test "attr-gnu-4-22" | |
495 | run_dump_test "attr-gnu-4-23" | |
42554f6a TS |
496 | run_dump_test "attr-gnu-4-24" |
497 | run_dump_test "attr-gnu-4-25" | |
2cf19d5c JM |
498 | run_dump_test "attr-gnu-4-30" |
499 | run_dump_test "attr-gnu-4-31" | |
500 | run_dump_test "attr-gnu-4-32" | |
501 | run_dump_test "attr-gnu-4-33" | |
42554f6a TS |
502 | run_dump_test "attr-gnu-4-34" |
503 | run_dump_test "attr-gnu-4-35" | |
504 | run_dump_test "attr-gnu-4-40" | |
2cf19d5c | 505 | run_dump_test "attr-gnu-4-41" |
42554f6a TS |
506 | run_dump_test "attr-gnu-4-42" |
507 | run_dump_test "attr-gnu-4-43" | |
508 | run_dump_test "attr-gnu-4-44" | |
509 | run_dump_test "attr-gnu-4-45" | |
510 | run_dump_test "attr-gnu-4-51" | |
634835ae RS |
511 | |
512 | if { $linux_gnu } { | |
513 | run_ld_link_tests { | |
514 | {"GOT and versioning 1" | |
515 | "-shared -melf32btsmip --version-script got-vers-1.ver" | |
516 | "-EB -mips2 -32" {got-vers-1a.s got-vers-1b.s} | |
517 | {{readelf -d got-vers-1.dd} | |
518 | {readelf --symbols got-vers-1.sd} | |
519 | {readelf --relocs got-vers-1.rd}} | |
520 | "got-vers-1.so"} | |
521 | } | |
522 | } | |
e7e2196d MR |
523 | |
524 | run_dump_test "undefined" |