]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - binutils/testsuite/binutils-all/readelf.exp
Add a testcase for PR binutils/26112
[thirdparty/binutils-gdb.git] / binutils / testsuite / binutils-all / readelf.exp
index 7a1edd6d1391ec1f968b5b51bc1e1ed6f43a77b5..cb924317bcc8ca4e9d15f7ee9cd7a6ae9c9215c3 100644 (file)
@@ -1,4 +1,4 @@
-#   Copyright (C) 1999-2018 Free Software Foundation, Inc.
+#   Copyright (C) 1999-2020 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -349,6 +349,7 @@ readelf_wi_test
 readelf_compressed_wa_test
 
 readelf_dump_test
+run_dump_test "pr25543"
 
 # PR 13482 - Check for off-by-one errors when dumping .note sections.
 if {![binutils_assemble $srcdir/$subdir/version.s tmpdir/version.o]} then {
@@ -489,7 +490,7 @@ if {![binutils_assemble $srcdir/$subdir/debuglink.s tmpdir/debuglink.o]} then {
            set tempfile2 [remote_download host tmpdir/linkdebug.debug]
        }
 
-       readelf_test {-wKis} $tempfile objdump.WK2  {}
+       readelf_test {-wKis} $tempfile readelf.wKis  {}
     }
 }
 
@@ -505,4 +506,28 @@ if {![binutils_assemble $srcdir/$subdir/dwo.s tmpdir/dwo.o]} then {
     readelf_test {--debug-dump=links} $tempfile readelf.k2  {}
 }
 
+if {![binutils_assemble $srcdir/$subdir/zero-sec.s tmpdir/zero-sec.o]} then {
+    unresolved "readelf --enable-checks (failed to assemble zero-sec.s)"
+} else {
+    if ![is_remote host] {
+       set tempfile tmpdir/zero-sec.o
+    } else {
+       set tempfile [remote_download host tmpdir/zero-sec.o]
+    }
+
+    readelf_test {--enable-checks --sections --wide} $tempfile zero-sec.r {}
+}
 
+if ![is_remote host] {
+    set test $srcdir/$subdir/pr26112.o.bz2
+    # We need to strip the ".bz2", but can leave the dirname.
+    set t $subdir/[file tail $test]
+    set testname [file rootname $t]
+    verbose $testname
+    set tempfile tmpdir/pr26112.o
+    if {[catch "system \"bzip2 -dc $test > $tempfile\""] != 0} {
+       untested "bzip2 -dc ($testname)"
+    } else {
+       readelf_test {--debug-dump=macro} $tempfile pr26112.r {}
+    }
+}