Commit | Line | Data |
---|---|---|
b3adc24a | 1 | # Copyright (C) 1999-2020 Free Software Foundation, Inc. |
252b5132 RH |
2 | |
3 | # This program is free software; you can redistribute it and/or modify | |
4 | # it under the terms of the GNU General Public License as published by | |
32866df7 | 5 | # the Free Software Foundation; either version 3 of the License, or |
252b5132 | 6 | # (at your option) any later version. |
65951855 | 7 | # |
252b5132 RH |
8 | # This program is distributed in the hope that it will be useful, |
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | # GNU General Public License for more details. | |
65951855 | 12 | # |
252b5132 RH |
13 | # You should have received a copy of the GNU General Public License |
14 | # along with this program; if not, write to the Free Software | |
b43b5d5f | 15 | # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. |
252b5132 RH |
16 | |
17 | # Please email any bugs, comments, and/or additions to this file to: | |
18 | # bug-dejagnu@prep.ai.mit.edu | |
19 | ||
113675b7 | 20 | # Written by Nick Clifton <nickc@cygnus.com> |
252b5132 RH |
21 | # Based on scripts written by Ian Lance Taylor <ian@cygnus.com> |
22 | # and Ken Raeburn <raeburn@cygnus.com>. | |
23 | ||
09c11c86 NC |
24 | # Exclude non-ELF targets. |
25 | if ![is_elf_format] { | |
26 | verbose "$READELF is only intended for ELF targets" 2 | |
27 | return | |
28 | } | |
29 | ||
252b5132 RH |
30 | # First some helpful procedures, then the tests themselves |
31 | ||
32 | # Return the contents of the filename given | |
33 | proc file_contents { filename } { | |
34 | set file [open $filename r] | |
35 | set contents [read $file] | |
36 | close $file | |
37 | return $contents | |
38 | } | |
39 | ||
9921923c HPN |
40 | # Find out the size by reading the output of the EI_CLASS field. |
41 | # Similar to the test for readelf -h, but we're just looking for the | |
42 | # EI_CLASS line here. | |
a0a8a934 | 43 | proc readelf_find_size { binary_file test_iteration } { |
9921923c HPN |
44 | global READELF |
45 | global READELFFLAGS | |
46 | global readelf_size | |
47 | ||
48 | set readelf_size "" | |
a0a8a934 | 49 | set testname "finding out ELF size with readelf -h ($test_iteration)" |
7f6a71ff JM |
50 | set got [remote_exec host "$READELF $READELFFLAGS -h $binary_file" "" "/dev/null" "readelf.out"] |
51 | if [is_remote host] then { | |
52 | remote_upload host "readelf.out" | |
53 | } | |
9921923c | 54 | |
7f6a71ff | 55 | if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]]} then { |
9921923c HPN |
56 | send_log $got |
57 | fail $testname | |
58 | return | |
59 | } | |
60 | ||
61 | if { ! [regexp "\n\[ \]*Class:\[ \]*ELF(\[0-9\]+)\n" \ | |
62 | [file_contents readelf.out] nil readelf_size] } { | |
63 | verbose -log "EI_CLASS field not found in output" | |
64 | verbose -log "output is \n[file_contents readelf.out]" | |
65 | fail $testname | |
66 | return | |
67 | } else { | |
68 | verbose -log "ELF size is $readelf_size" | |
69 | } | |
70 | ||
71 | pass $testname | |
72 | } | |
73 | ||
252b5132 RH |
74 | # Run an individual readelf test. |
75 | # Basically readelf is run on the binary_file with the given options. | |
76 | # Readelf's output is captured and then compared against the contents | |
9921923c | 77 | # of the regexp_file-readelf_size if it exists, else regexp_file. |
252b5132 RH |
78 | |
79 | proc readelf_test { options binary_file regexp_file xfails } { | |
80 | ||
81 | global READELF | |
82 | global READELFFLAGS | |
9921923c | 83 | global readelf_size |
252b5132 RH |
84 | global srcdir |
85 | global subdir | |
65951855 | 86 | |
11bb0c7a AM |
87 | set testname "readelf $options [file rootname [file tail $binary_file]]" |
88 | ||
9921923c | 89 | send_log "exec $READELF $READELFFLAGS $options $binary_file > readelf.out\n" |
7f6a71ff | 90 | set got [remote_exec host "$READELF $READELFFLAGS $options $binary_file" "" "/dev/null" "readelf.out"] |
252b5132 | 91 | |
9a1c9383 NC |
92 | foreach xfail $xfails { |
93 | setup_xfail $xfail | |
252b5132 | 94 | } |
3f7de0e7 | 95 | |
7f6a71ff | 96 | if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then { |
11bb0c7a | 97 | fail "$testname (reason: unexpected output)" |
252b5132 | 98 | send_log $got |
3f7de0e7 | 99 | send_log "\n" |
252b5132 RH |
100 | return |
101 | } | |
102 | ||
ade0b24f NC |
103 | set target_machine "" |
104 | if [istarget "mips*-*-*"] then { | |
9cc0123f | 105 | if [is_bad_symtab] then { |
eed3fa3b | 106 | set target_machine mips |
9cc0123f AM |
107 | } else { |
108 | set target_machine tmips | |
eed3fa3b | 109 | } |
ade0b24f NC |
110 | } |
111 | ||
112 | if { $target_machine != "" && [file exists $srcdir/$subdir/$regexp_file-$readelf_size-$target_machine] } then { | |
113 | set regexp_file $regexp_file-$readelf_size-$target_machine | |
114 | } elseif { $target_machine != "" && [file exists $srcdir/$subdir/$regexp_file-$target_machine] } then { | |
115 | set regexp_file $regexp_file-$target_machine | |
116 | } elseif { [file exists $srcdir/$subdir/$regexp_file-$readelf_size] } then { | |
9921923c HPN |
117 | set regexp_file $regexp_file-$readelf_size |
118 | } | |
119 | ||
252b5132 | 120 | if { [regexp_diff readelf.out $srcdir/$subdir/$regexp_file] } then { |
11bb0c7a | 121 | fail $testname |
252b5132 RH |
122 | verbose "output is \n[file_contents readelf.out]" 2 |
123 | return | |
124 | } | |
125 | ||
11bb0c7a | 126 | pass $testname |
252b5132 RH |
127 | } |
128 | ||
cbb356d9 NC |
129 | # Simple proc to skip certain expected warning messages. |
130 | ||
131 | proc prune_readelf_wi_warnings { text } { | |
132 | regsub -all "(^|\n)(.*Skipping unexpected symbol type.*)" $text "\\1" text | |
133 | return $text | |
134 | } | |
135 | ||
136 | # Testing the "readelf -wi" option is difficult because there | |
137 | # is no guaranteed order to the output, and because some ports | |
138 | # will use indirect string references, whilst others will use | |
139 | # direct references. So instead of having an expected output | |
140 | # file, like the other readelf tests, we grep for strings that | |
141 | # really ought to be there. | |
142 | ||
143 | proc readelf_wi_test {} { | |
144 | global READELF | |
145 | global READELFFLAGS | |
146 | global srcdir | |
147 | global subdir | |
65951855 | 148 | |
cbb356d9 NC |
149 | # Compile the second test file. |
150 | if { [target_compile $srcdir/$subdir/testprog.c tmpdir/testprog.o object debug] != "" } { | |
151 | verbose "Unable to compile test file." | |
152 | untested "readelf -wi" | |
153 | return | |
154 | } | |
155 | ||
156 | # Download it. | |
8d263650 | 157 | set tempfile [remote_download host tmpdir/testprog.o] |
cbb356d9 NC |
158 | |
159 | # Run "readelf -wi" on it. | |
7f6a71ff | 160 | set got [remote_exec host "$READELF $READELFFLAGS -wi $tempfile" "" "/dev/null" "readelf.out"] |
cbb356d9 NC |
161 | |
162 | # Upload the results. | |
8d263650 | 163 | set output [remote_upload host readelf.out] |
cbb356d9 | 164 | |
8d263650 | 165 | file_on_host delete $tempfile |
65951855 | 166 | |
cbb356d9 | 167 | # Strip any superflous warnings. |
7f6a71ff | 168 | set got [prune_readelf_wi_warnings [lindex $got 1]] |
cbb356d9 NC |
169 | |
170 | if ![string match "" $got] then { | |
b279a55c | 171 | fail "readelf $READELFFLAGS -wi (reason: unexpected output)" |
cbb356d9 NC |
172 | send_log $got |
173 | send_log "\n" | |
174 | return | |
175 | } | |
176 | ||
177 | if ![file size $output] then { | |
178 | # If the output file is empty, then this target does not | |
179 | # generate dwarf2 output. This is not a failure. | |
180 | verbose "No output from 'readelf -wi'" | |
181 | untested "readelf -wi" | |
182 | return | |
183 | } | |
65951855 | 184 | |
cbb356d9 NC |
185 | # Search for strings that should be in the output. |
186 | set sought { | |
187 | ".*DW_TAG_compile_unit.*" | |
188 | ".*DW_TAG_subprogram.*" | |
189 | ".*DW_TAG_base_type.*" | |
190 | ".*DW_AT_producer.*(GNU C|indirect string).*" | |
191 | ".*DW_AT_language.*ANSI C.*" | |
192 | ".*DW_AT_name.*(testprog.c|indirect string).*" | |
193 | ".*DW_AT_name.*fn.*" | |
194 | ".*DW_AT_name.*(main|indirect string).*" | |
aaa222e7 | 195 | ".*\(DW_OP_addr: 0\).*" |
cbb356d9 | 196 | } |
65951855 | 197 | |
13761a11 NC |
198 | # The MSP430 in LARGE mode does not generate a DW_OP_addr. |
199 | setup_xfail msp430*-*-* | |
200 | ||
65951855 | 201 | foreach looked_for $sought { |
cbb356d9 NC |
202 | set lines [grep $output $looked_for] |
203 | if ![llength $lines] then { | |
204 | fail "readelf -wi: missing: $looked_for" | |
205 | send_log readelf.out | |
206 | return | |
207 | } | |
208 | } | |
209 | ||
8d263650 | 210 | file_on_host delete $output |
65951855 | 211 | |
cbb356d9 NC |
212 | # All done. |
213 | pass "readelf -wi" | |
214 | } | |
252b5132 | 215 | |
1b315056 CS |
216 | # This tests "readelf -wa", but on a file with a compressed |
217 | # .debug_abbrev section. | |
218 | ||
219 | proc readelf_compressed_wa_test {} { | |
220 | global READELF | |
221 | global READELFFLAGS | |
222 | global srcdir | |
223 | global subdir | |
65951855 | 224 | |
1b315056 CS |
225 | # Compile the compressed-debug-section test file. |
226 | if { [target_compile $srcdir/$subdir/dw2-compressed.S tmpdir/dw2-compressed.o object debug] != "" } { | |
227 | verbose "Unable to compile test file." | |
228 | untested "readelf -wa (compressed)" | |
229 | return | |
230 | } | |
231 | ||
232 | # Download it. | |
233 | set tempfile [remote_download host tmpdir/dw2-compressed.o] | |
234 | ||
235 | # Run "readelf -wa" on it. | |
236 | set got [remote_exec host "$READELF $READELFFLAGS -wa $tempfile" "" "/dev/null" "readelf.out"] | |
237 | ||
238 | # Upload the results. | |
239 | set output [remote_upload host readelf.out] | |
240 | ||
241 | file_on_host delete $tempfile | |
65951855 | 242 | |
1b315056 CS |
243 | if { [string compare [file_contents readelf.out] [file_contents $srcdir/$subdir/readelf.wa]] != 0 } then { |
244 | fail "readelf -wa (compressed)" | |
245 | verbose "output is \n[file_contents readelf.out]" 2 | |
246 | verbose "expected is \n[file_contents $srcdir/$subdir/readelf.wa]" 2 | |
247 | return | |
248 | } | |
249 | ||
250 | pass "readelf -wa (compressed)" | |
251 | } | |
252b5132 | 252 | |
09c11c86 NC |
253 | # Test readelf's dumping abilities. |
254 | ||
255 | proc readelf_dump_test {} { | |
256 | global READELF | |
257 | global READELFFLAGS | |
258 | global srcdir | |
259 | global subdir | |
65951855 | 260 | |
09c11c86 NC |
261 | # Assemble the dump test file. |
262 | if {![binutils_assemble $srcdir/$subdir/dumptest.s tmpdir/dumptest.o]} then { | |
263 | unresolved "readelf -p: failed to assemble dump test file" | |
264 | return | |
265 | } | |
266 | # Download it. | |
267 | set tempfile [remote_download host tmpdir/dumptest.o] | |
268 | ||
269 | # Run "readelf -p.data" on it. | |
96037eb0 NC |
270 | set sect_names [get_standard_section_names] |
271 | if { $sect_names != "" } { | |
272 | set got [remote_exec host "$READELF $READELFFLAGS -p[lindex $sect_names 1] $tempfile" "" "/dev/null" "readelf.out"] | |
273 | } else { | |
274 | set got [remote_exec host "$READELF $READELFFLAGS -p.data $tempfile" "" "/dev/null" "readelf.out"] | |
275 | } | |
09c11c86 NC |
276 | set got [lindex $got 1] |
277 | ||
278 | # Upload the results. | |
279 | set output [remote_upload host readelf.out] | |
280 | ||
281 | # Check for something going wrong. | |
282 | if ![string match "" $got] then { | |
283 | fail "readelf -p: unexpected output" | |
284 | send_log $got | |
285 | send_log "\n" | |
286 | return | |
287 | } | |
288 | ||
289 | # Search for strings that should be in the output. | |
290 | set sought { | |
291 | ".*test_string.*" | |
292 | } | |
65951855 RM |
293 | |
294 | foreach looked_for $sought { | |
09c11c86 NC |
295 | set lines [grep $output $looked_for] |
296 | if ![llength $lines] then { | |
297 | fail "readelf -p: missing: $looked_for" | |
298 | send_log readelf.out | |
299 | return | |
300 | } | |
301 | } | |
302 | ||
65951855 | 303 | file_on_host delete $tempfile |
09c11c86 NC |
304 | file_on_host delete $output |
305 | ||
306 | # All done. | |
307 | pass "readelf -p" | |
308 | ||
309 | # XXX FIXME: Add test of readelf -x here | |
252b5132 RH |
310 | } |
311 | ||
312 | if ![is_remote host] { | |
313 | if {[which $READELF] == 0} then { | |
314 | perror "$READELF does not exist" | |
315 | return | |
316 | } | |
317 | } | |
318 | ||
319 | send_user "Version [binutil_version $READELF]" | |
320 | ||
89084430 | 321 | # Assemble the test file. |
252b5132 | 322 | if {![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.o]} then { |
11bb0c7a AM |
323 | unresolved "readelf -h bintest (failed to assemble)" |
324 | unresolved "readelf -S bintest (failed to assemble)" | |
325 | unresolved "readelf -s bintest (failed to assemble)" | |
326 | unresolved "readelf -r bintest (failed to assemble)" | |
f3185997 NC |
327 | global readelf_size |
328 | set readelf_size "" | |
252b5132 | 329 | } else { |
252b5132 | 330 | |
11bb0c7a AM |
331 | if ![is_remote host] { |
332 | set tempfile tmpdir/bintest.o | |
333 | } else { | |
334 | set tempfile [remote_download host tmpdir/bintest.o] | |
335 | } | |
9921923c | 336 | |
11bb0c7a | 337 | # First, determine the size, so specific output matchers can be used. |
a0a8a934 | 338 | readelf_find_size $tempfile 1 |
11bb0c7a AM |
339 | |
340 | # Run the tests. | |
341 | readelf_test -h $tempfile readelf.h {} | |
342 | readelf_test -S $tempfile readelf.s {} | |
343 | setup_xfail "mips-*-*irix*" | |
344 | readelf_test -s $tempfile readelf.ss {} | |
345 | readelf_test -r $tempfile readelf.r {} | |
346 | } | |
252b5132 | 347 | |
cbb356d9 | 348 | readelf_wi_test |
1b315056 | 349 | readelf_compressed_wa_test |
09c11c86 NC |
350 | |
351 | readelf_dump_test | |
ba3265d0 | 352 | run_dump_test "pr25543" |
8b971f9f NC |
353 | |
354 | # PR 13482 - Check for off-by-one errors when dumping .note sections. | |
355 | if {![binutils_assemble $srcdir/$subdir/version.s tmpdir/version.o]} then { | |
11bb0c7a | 356 | unresolved "readelf -n version (failed to assemble)" |
8b971f9f | 357 | } else { |
0e602686 NC |
358 | |
359 | if ![is_remote host] { | |
360 | set tempfile tmpdir/version.o | |
361 | } else { | |
362 | set tempfile [remote_download host tmpdir/version.o] | |
363 | } | |
364 | ||
365 | readelf_test -n $tempfile readelf.n {} | |
8b971f9f NC |
366 | } |
367 | ||
d1c4b12b NC |
368 | |
369 | # PR 18374 - Check that relocations against the .debug_loc section | |
370 | # do not prevent readelf from displaying all the location lists. | |
371 | if {![binutils_assemble $srcdir/$subdir/pr18374.s tmpdir/pr18374.o]} then { | |
11bb0c7a | 372 | unresolved "readelf --debug-dump=loc pr18374 (failed to assemble)" |
0e602686 NC |
373 | } else { |
374 | ||
375 | if ![is_remote host] { | |
376 | set tempfile tmpdir/pr18374.o | |
377 | } else { | |
378 | set tempfile [remote_download host tmpdir/pr18374.o] | |
379 | } | |
380 | ||
381 | readelf_test --debug-dump=loc $tempfile readelf.pr18374 {} | |
d1c4b12b NC |
382 | } |
383 | ||
0e602686 | 384 | |
9f272209 AO |
385 | # locview - Check dumping of location lists with location views. |
386 | if {![binutils_assemble $srcdir/$subdir/locview-1.s tmpdir/locview-1.o]} then { | |
387 | unresolved "readelf --debug-dump=loc locview-1 (failed to assemble)" | |
388 | } else { | |
389 | ||
390 | if ![is_remote host] { | |
391 | set tempfile tmpdir/locview-1.o | |
392 | } else { | |
393 | set tempfile [remote_download host tmpdir/locview-1.o] | |
394 | } | |
395 | ||
396 | readelf_test --debug-dump=loc $tempfile readelf.locview-1 {} | |
397 | } | |
398 | if {![binutils_assemble $srcdir/$subdir/locview-2.s tmpdir/locview-2.o]} then { | |
399 | unresolved "readelf --debug-dump=loc locview-2 (failed to assemble)" | |
400 | } else { | |
401 | ||
402 | if ![is_remote host] { | |
403 | set tempfile tmpdir/locview-2.o | |
404 | } else { | |
405 | set tempfile [remote_download host tmpdir/locview-2.o] | |
406 | } | |
407 | ||
408 | readelf_test --debug-dump=loc $tempfile readelf.locview-2 {} | |
409 | } | |
410 | ||
411 | ||
0e602686 NC |
412 | # Check that decompressed dumps work. |
413 | if {![binutils_assemble $srcdir/$subdir/z.s tmpdir/z.o]} then { | |
11bb0c7a | 414 | unresolved "readelf --decompress --hex-dump .debug_loc z (failed to assemble)" |
d1c4b12b | 415 | } else { |
d1c4b12b | 416 | |
0e602686 NC |
417 | if ![is_remote host] { |
418 | set tempfile tmpdir/z.o | |
419 | } else { | |
420 | set tempfile [remote_download host tmpdir/z.o] | |
421 | } | |
422 | ||
423 | readelf_test {--decompress --hex-dump .debug_loc} $tempfile readelf.z {} | |
424 | } | |
a567769b | 425 | |
04914e37 NC |
426 | # Skip the next test for the RISCV architectures because they |
427 | # do not support .ULEB128 pseudo-ops with non-constant values. | |
a567769b JK |
428 | if ![istarget "riscv*-*-*"] then { |
429 | ||
3b83ea38 AM |
430 | set hpux "" |
431 | if [istarget "hppa*64*-*-hpux*"] { | |
432 | set hpux "--defsym HPUX=1" | |
433 | } | |
04914e37 | 434 | |
a567769b | 435 | # Assemble the DWARF-5 test file. |
3b83ea38 | 436 | if {![binutils_assemble_flags $srcdir/$subdir/dw5.S tmpdir/dw5.o $hpux]} then { |
11bb0c7a | 437 | unresolved "readelf -wiaoRlL dw5 (failed to assemble)" |
a567769b | 438 | } else { |
a567769b | 439 | |
11bb0c7a AM |
440 | # Download it. |
441 | if ![is_remote host] { | |
442 | set tempfile tmpdir/dw5.o | |
443 | } else { | |
444 | set tempfile [remote_download host tmpdir/dw5.o] | |
445 | } | |
446 | ||
447 | # First, determine the size, so specific output matchers can be used. | |
a0a8a934 | 448 | readelf_find_size $tempfile 2 |
a567769b | 449 | |
11bb0c7a | 450 | # Make sure that readelf can decode the contents. |
9f272209 | 451 | readelf_test -wiaoRlL $tempfile dw5.W { nds32*-elf } |
11bb0c7a | 452 | } |
a567769b | 453 | } |
04914e37 NC |
454 | |
455 | # Assemble the DWARF-5 attributes test file. | |
456 | if {![binutils_assemble_flags $srcdir/$subdir/dwarf-attributes.S tmpdir/dwarf-attributes.o ""]} then { | |
457 | unresolved "readelf -wi dwarf-attributes (failed to assemble)" | |
458 | } else { | |
459 | # Download it. | |
460 | if ![is_remote host] { | |
461 | set tempfile tmpdir/dwarf-attributes.o | |
462 | } else { | |
463 | set tempfile [remote_download host tmpdir/dwarf-attributes.o] | |
464 | } | |
465 | ||
466 | # First, determine the size, so specific output matchers can be used. | |
a0a8a934 | 467 | readelf_find_size $tempfile 3 |
04914e37 NC |
468 | |
469 | # Make sure that readelf can decode the contents. | |
470 | readelf_test -wi $tempfile dwarf-attributes.W {} | |
471 | } | |
dda8d76d NC |
472 | |
473 | # Check that debug link sections can be dumped. | |
474 | if {![binutils_assemble $srcdir/$subdir/debuglink.s tmpdir/debuglink.o]} then { | |
d85bf2ba | 475 | unresolved "readelf --debug-dump=links (failed to assemble debuglink.s)" |
dda8d76d NC |
476 | } else { |
477 | if ![is_remote host] { | |
478 | set tempfile tmpdir/debuglink.o | |
479 | } else { | |
480 | set tempfile [remote_download host tmpdir/debuglink.o] | |
481 | } | |
482 | ||
483 | readelf_test {--debug-dump=links} $tempfile readelf.k {} | |
dda8d76d | 484 | |
d85bf2ba | 485 | # Check that debug link sections can be followed. |
dda8d76d | 486 | if {![binutils_assemble $srcdir/$subdir/linkdebug.s tmpdir/linkdebug.debug]} then { |
d85bf2ba | 487 | unresolved "readelf --debug-dump=follow-links (failed to assemble linkdebug.s)" |
dda8d76d | 488 | } else { |
d85bf2ba NC |
489 | if [is_remote host] { |
490 | set tempfile2 [remote_download host tmpdir/linkdebug.debug] | |
dda8d76d NC |
491 | } |
492 | ||
39f0547e | 493 | readelf_test {-wKis} $tempfile readelf.wKis {} |
dda8d76d NC |
494 | } |
495 | } | |
496 | ||
d85bf2ba NC |
497 | if {![binutils_assemble $srcdir/$subdir/dwo.s tmpdir/dwo.o]} then { |
498 | unresolved "readelf --debug-dump=links (failed to assemble dwo.s)" | |
499 | } else { | |
500 | if ![is_remote host] { | |
501 | set tempfile tmpdir/dwo.o | |
502 | } else { | |
503 | set tempfile [remote_download host tmpdir/dwo.o] | |
504 | } | |
505 | ||
506 | readelf_test {--debug-dump=links} $tempfile readelf.k2 {} | |
507 | } | |
508 | ||
1b513401 NC |
509 | if {![binutils_assemble $srcdir/$subdir/zero-sec.s tmpdir/zero-sec.o]} then { |
510 | unresolved "readelf --enable-checks (failed to assemble zero-sec.s)" | |
511 | } else { | |
512 | if ![is_remote host] { | |
513 | set tempfile tmpdir/zero-sec.o | |
514 | } else { | |
515 | set tempfile [remote_download host tmpdir/zero-sec.o] | |
516 | } | |
517 | ||
518 | readelf_test {--enable-checks --sections --wide} $tempfile zero-sec.r {} | |
519 | } | |
d85bf2ba | 520 | |
80fda85c L |
521 | if ![is_remote host] { |
522 | set test $srcdir/$subdir/pr26112.o.bz2 | |
523 | # We need to strip the ".bz2", but can leave the dirname. | |
524 | set t $subdir/[file tail $test] | |
525 | set testname [file rootname $t] | |
526 | verbose $testname | |
527 | set tempfile tmpdir/pr26112.o | |
528 | if {[catch "system \"bzip2 -dc $test > $tempfile\""] != 0} { | |
529 | untested "bzip2 -dc ($testname)" | |
530 | } else { | |
531 | readelf_test {--debug-dump=macro} $tempfile pr26112.r {} | |
532 | } | |
533 | } |