+ if ![is_remote host] {
+ set tempfile tmpdir/pr18374.o
+ } else {
+ set tempfile [remote_download host tmpdir/pr18374.o]
+ }
+
+ readelf_test --debug-dump=loc $tempfile readelf.pr18374 {}
+}
+
+
+# locview - Check dumping of location lists with location views.
+if {![binutils_assemble $srcdir/$subdir/locview-1.s tmpdir/locview-1.o]} then {
+ unresolved "readelf --debug-dump=loc locview-1 (failed to assemble)"
+} else {
+
+ if ![is_remote host] {
+ set tempfile tmpdir/locview-1.o
+ } else {
+ set tempfile [remote_download host tmpdir/locview-1.o]
+ }
+
+ readelf_test --debug-dump=loc $tempfile readelf.locview-1 {}
+}
+if {![binutils_assemble $srcdir/$subdir/locview-2.s tmpdir/locview-2.o]} then {
+ unresolved "readelf --debug-dump=loc locview-2 (failed to assemble)"
+} else {
+
+ if ![is_remote host] {
+ set tempfile tmpdir/locview-2.o
+ } else {
+ set tempfile [remote_download host tmpdir/locview-2.o]
+ }
+
+ readelf_test --debug-dump=loc $tempfile readelf.locview-2 {}
+}
+
+
+# Check that decompressed dumps work.
+if {![binutils_assemble $srcdir/$subdir/z.s tmpdir/z.o]} then {
+ unresolved "readelf --decompress --hex-dump .debug_loc z (failed to assemble)"
+} else {
+
+ if ![is_remote host] {
+ set tempfile tmpdir/z.o
+ } else {
+ set tempfile [remote_download host tmpdir/z.o]
+ }
+
+ readelf_test {--decompress --hex-dump .debug_loc} $tempfile readelf.z {}
+}
+
+# Skip the next test for the RISCV architectures because they
+# do not support .ULEB128 pseudo-ops with non-constant values.
+if ![istarget "riscv*-*-*"] then {
+
+ set hpux ""
+ if [istarget "hppa*64*-*-hpux*"] {
+ set hpux "--defsym HPUX=1"
+ }
+
+ # Assemble the DWARF-5 test file.
+ if {![binutils_assemble_flags $srcdir/$subdir/dw5.S tmpdir/dw5.o $hpux]} then {
+ unresolved "readelf -wiaoRlL dw5 (failed to assemble)"
+ } else {
+
+ # 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 2
+
+ # Make sure that readelf can decode the contents.
+ readelf_test -wiaoRlL $tempfile dw5.W { nds32*-elf }
+ }
+}
+
+# Assemble the DWARF-5 attributes test file.
+if {![binutils_assemble_flags $srcdir/$subdir/dwarf-attributes.S tmpdir/dwarf-attributes.o ""]} then {
+ unresolved "readelf -wi dwarf-attributes (failed to assemble)"
+} else {
+ # Download it.
+ if ![is_remote host] {
+ set tempfile tmpdir/dwarf-attributes.o
+ } else {
+ set tempfile [remote_download host tmpdir/dwarf-attributes.o]
+ }
+
+ # First, determine the size, so specific output matchers can be used.
+ readelf_find_size $tempfile 3
+
+ # Make sure that readelf can decode the contents.
+ readelf_test -wi $tempfile dwarf-attributes.W {}
+}
+
+# Check that debug link sections can be dumped.
+if {![binutils_assemble $srcdir/$subdir/debuglink.s tmpdir/debuglink.o]} then {
+ unresolved "readelf --debug-dump=links (failed to assemble debuglink.s)"
+} else {
+ if ![is_remote host] {
+ set tempfile tmpdir/debuglink.o
+ } else {
+ set tempfile [remote_download host tmpdir/debuglink.o]
+ }
+
+ readelf_test {--debug-dump=links} $tempfile readelf.k {}
+
+ # Check that debug link sections can be followed.
+ if {![binutils_assemble $srcdir/$subdir/linkdebug.s tmpdir/linkdebug.debug]} then {
+ unresolved "readelf --debug-dump=follow-links (failed to assemble linkdebug.s)"
+ } else {
+ if [is_remote host] {
+ set tempfile2 [remote_download host tmpdir/linkdebug.debug]
+ }
+
+ readelf_test {-wKis} $tempfile readelf.wKis {}
+ }
+}
+
+if {![binutils_assemble $srcdir/$subdir/dwo.s tmpdir/dwo.o]} then {
+ unresolved "readelf --debug-dump=links (failed to assemble dwo.s)"
+} else {
+ if ![is_remote host] {
+ set tempfile tmpdir/dwo.o
+ } else {
+ set tempfile [remote_download host tmpdir/dwo.o]
+ }
+
+ 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 {}
+ }
+}