diff options
author | Nick Clifton <nickc@redhat.com> | 2021-02-12 14:52:22 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2021-02-12 14:52:22 +0000 |
commit | c46b706620eb9b27fa06e26406ffa4f79d9292e6 (patch) | |
tree | 0ec6f7bf04f8c7d05eb71ec5698d847a09777965 /binutils/testsuite | |
parent | 96df3e28b835ccb5804bcca96f417761e5e8be67 (diff) | |
download | gdb-c46b706620eb9b27fa06e26406ffa4f79d9292e6.zip gdb-c46b706620eb9b27fa06e26406ffa4f79d9292e6.tar.gz gdb-c46b706620eb9b27fa06e26406ffa4f79d9292e6.tar.bz2 |
Change the readelf and objdump programs so that they will automatically follow links to separate debug info files.
* configure.ac (follow-debug-links): Add option to enable or
disable the following of debug links by default. Set the
default for the option to be 'follow'.
* dwarf.c (do_follow_links): Initialise with DEFAULT_FOR_FOLLOW_LINKS.
(dwarf_select_sections_by_names): Add no-follow-links option.
(dwarf_select_sections_by_letter): Add 'N' option.
* objdump.c (usage): Add conditional text describing the
follow links option.
(slurp_symtab): Ensure that there is a NULL entry at the end
of the symbol table.
(slurp_dynamic_symtab): Likewise.
(dump_bfd): When extending the symbol table, ensure that there
is still a NULL entry at the end.
* readelf.c (usage): Add conditional text describing the
follow links option.
* doc/binutils.texi: Update documentation for objcopy and
readelf.
* doc/debug.options.texi: Update documentation of the
follow-links option.
* config.in: Regenerate.
* configure: Regenerate.
* testsuite/binutils-all/compress.exp: Add the -WN option to
objdump command lines that are not expecting to follow links.
* testsuite/binutils-all/readelf.exp: Add the
--debug-dump=no-follow-links option to tests that are not
expecting to follow debug links.
gas * testsuite/gas/mach-o/sections-1.d: Stop automatic debug link
following.
* testsuite/gas/xgate/insns-dwarf2.d: Likewise.
ld * testsuite/ld-elf/sec64k.exp: Stop readelf from automatically
following debug links.
Diffstat (limited to 'binutils/testsuite')
-rw-r--r-- | binutils/testsuite/binutils-all/compress.exp | 4 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/objdump.exp | 4 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/readelf.exp | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/binutils/testsuite/binutils-all/compress.exp b/binutils/testsuite/binutils-all/compress.exp index e0e04f0..5801f6b 100644 --- a/binutils/testsuite/binutils-all/compress.exp +++ b/binutils/testsuite/binutils-all/compress.exp @@ -717,7 +717,7 @@ proc test_gnu_debuglink {} { fail "$test (objcopy link decompress)" return } - set got [remote_exec host "$OBJDUMP -S tmpdir/testprog" "" "/dev/null" "tmpdir/testprog.decompress.dump"] + set got [remote_exec host "$OBJDUMP -S -WN tmpdir/testprog" "" "/dev/null" "tmpdir/testprog.decompress.dump"] if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then { fail "$test (objcopy dump decompress)" return @@ -726,7 +726,7 @@ proc test_gnu_debuglink {} { fail "$test (objcopy link compress)" return } - set got [remote_exec host "$OBJDUMP -S tmpdir/testprog" "" "/dev/null" "tmpdir/testprog.compress.dump"] + set got [remote_exec host "$OBJDUMP -S -WN tmpdir/testprog" "" "/dev/null" "tmpdir/testprog.compress.dump"] if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then { fail "$test (objcopy dump compress)" return diff --git a/binutils/testsuite/binutils-all/objdump.exp b/binutils/testsuite/binutils-all/objdump.exp index aa8c207..6f95d40 100644 --- a/binutils/testsuite/binutils-all/objdump.exp +++ b/binutils/testsuite/binutils-all/objdump.exp @@ -606,7 +606,7 @@ if { [is_elf_format] } then { set testfile tmpdir/debuglink.${obj} } - set got [remote_exec host "$OBJDUMP $OBJDUMPFLAGS -Wk $testfile" "" "/dev/null" "objdump.out"] + set got [remote_exec host "$OBJDUMP $OBJDUMPFLAGS -Wk -WN $testfile" "" "/dev/null" "objdump.out"] if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then { fail "objdump -Wk (reason: unexpected output)" @@ -615,7 +615,7 @@ if { [is_elf_format] } then { } if { [regexp_diff objdump.out $srcdir/$subdir/objdump.Wk] } then { - fail "objdump -Wk" + fail "objdump -Wk (reason: output does not match expectations)" } else { pass "objdump -Wk" } diff --git a/binutils/testsuite/binutils-all/readelf.exp b/binutils/testsuite/binutils-all/readelf.exp index 948323c..7116408 100644 --- a/binutils/testsuite/binutils-all/readelf.exp +++ b/binutils/testsuite/binutils-all/readelf.exp @@ -507,7 +507,7 @@ if {![binutils_assemble $srcdir/$subdir/debuglink.s tmpdir/debuglink.o]} then { set tempfile [remote_download host tmpdir/debuglink.o] } - readelf_test {--debug-dump=links} $tempfile readelf.k {} + readelf_test {--debug-dump=links -wN} $tempfile readelf.k {} # Check that debug link sections can be followed. if {![binutils_assemble $srcdir/$subdir/linkdebug.s tmpdir/linkdebug.debug]} then { @@ -530,7 +530,7 @@ if {![binutils_assemble $srcdir/$subdir/dwo.s tmpdir/dwo.o]} then { set tempfile [remote_download host tmpdir/dwo.o] } - readelf_test {--debug-dump=links} $tempfile readelf.k2 {} + readelf_test {--debug-dump=links --debug-dump=no-follow-links} $tempfile readelf.k2 {} } if {![binutils_assemble $srcdir/$subdir/zero-sec.s tmpdir/zero-sec.o]} then { @@ -555,6 +555,6 @@ if ![is_remote host] { if {[catch "system \"bzip2 -dc $test > $tempfile\""] != 0} { untested "bzip2 -dc ($testname)" } else { - readelf_test {--debug-dump=macro} $tempfile pr26112.r {} + readelf_test {--debug-dump=macro -wN} $tempfile pr26112.r {} } } |