global srcdir
global subdir
+ set testname "readelf $options [file rootname [file tail $binary_file]]"
+
send_log "exec $READELF $READELFFLAGS $options $binary_file > readelf.out\n"
set got [remote_exec host "$READELF $READELFFLAGS $options $binary_file" "" "/dev/null" "readelf.out"]
}
if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
- fail "readelf $options (reason: unexpected output)"
+ fail "$testname (reason: unexpected output)"
send_log $got
send_log "\n"
return
}
if { [regexp_diff readelf.out $srcdir/$subdir/$regexp_file] } then {
- fail "readelf $options"
+ fail $testname
verbose "output is \n[file_contents readelf.out]" 2
return
}
- pass "readelf $options"
+ pass $testname
}
# Simple proc to skip certain expected warning messages.
# Assemble the test file.
if {![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.o]} then {
- perror "could not assemble test file"
- unresolved "readelf - failed to assemble"
- return
-}
-
-if ![is_remote host] {
- set tempfile tmpdir/bintest.o
+ unresolved "readelf -h bintest (failed to assemble)"
+ unresolved "readelf -S bintest (failed to assemble)"
+ unresolved "readelf -s bintest (failed to assemble)"
+ unresolved "readelf -r bintest (failed to assemble)"
} else {
- set tempfile [remote_download host tmpdir/bintest.o]
-}
-# First, determine the size, so specific output matchers can be used.
-readelf_find_size $tempfile
+ if ![is_remote host] {
+ set tempfile tmpdir/bintest.o
+ } else {
+ set tempfile [remote_download host tmpdir/bintest.o]
+ }
-# Run the tests.
-readelf_test -h $tempfile readelf.h {}
-readelf_test -S $tempfile readelf.s {}
-setup_xfail "mips-*-*irix*"
-readelf_test -s $tempfile readelf.ss {}
-readelf_test -r $tempfile readelf.r {}
+ # First, determine the size, so specific output matchers can be used.
+ readelf_find_size $tempfile
+
+ # Run the tests.
+ readelf_test -h $tempfile readelf.h {}
+ readelf_test -S $tempfile readelf.s {}
+ setup_xfail "mips-*-*irix*"
+ readelf_test -s $tempfile readelf.ss {}
+ readelf_test -r $tempfile readelf.r {}
+}
readelf_wi_test
readelf_compressed_wa_test
# PR 13482 - Check for off-by-one errors when dumping .note sections.
if {![binutils_assemble $srcdir/$subdir/version.s tmpdir/version.o]} then {
- perror "could not assemble version note test file"
- unresolved "readelf - failed to assemble"
- fail "readelf -n"
+ unresolved "readelf -n version (failed to assemble)"
} else {
if ![is_remote host] {
# PR 18374 - Check that relocations against the .debug_loc section
# do not prevent readelf from displaying all the location lists.
if {![binutils_assemble $srcdir/$subdir/pr18374.s tmpdir/pr18374.o]} then {
- perror "could not assemble PR18374 test file"
- unresolved "readelf - failed to assemble"
- fail "readelf --debug-loc"
+ unresolved "readelf --debug-dump=loc pr18374 (failed to assemble)"
} else {
if ![is_remote host] {
# Check that decompressed dumps work.
if {![binutils_assemble $srcdir/$subdir/z.s tmpdir/z.o]} then {
- perror "could not assemble decompress dump test file"
- unresolved "readelf - failed to assemble"
- fail "readelf -z"
+ unresolved "readelf --decompress --hex-dump .debug_loc z (failed to assemble)"
} else {
if ![is_remote host] {
}
# Assemble the DWARF-5 test file.
if {![binutils_assemble_flags $srcdir/$subdir/dw5.S tmpdir/dw5.o $hpux]} then {
- perror "could not assemble dw5 test file"
- unresolved "readelf - failed to assemble dw5"
- return
- }
-
- # Download it.
- if ![is_remote host] {
- set tempfile tmpdir/dw5.o
+ unresolved "readelf -wiaoRlL dw5 (failed to assemble)"
} else {
- set tempfile [remote_download host tmpdir/dw5.o]
- }
- # First, determine the size, so specific output matchers can be used.
- readelf_find_size $tempfile
+ # Download it.
+ if ![is_remote host] {
+ set tempfile tmpdir/dw5.o
+ } else {
+ set tempfile [remote_download host tmpdir/dw5.o]
+ }
+
+ # First, determine the size, so specific output matchers can be used.
+ readelf_find_size $tempfile
- # Make sure that readelf can decode the contents.
- readelf_test -wiaoRlL $tempfile dw5.W {}
+ # Make sure that readelf can decode the contents.
+ readelf_test -wiaoRlL $tempfile dw5.W {}
+ }
}