Commit: Extend objdump's --dwarf=follow-links option
Nick Clifton
nickc@redhat.com
Mon Feb 25 12:15:00 GMT 2019
Hi Guys,
I am checking in the attached patch to extend objdump's
--dwarf=follow-link option. With this extension any dumping options,
eg --syms, will also be applied to any linked debug information files.
In addition any symbol tables in linked debug info files will be read
in and used when disassembling. This means that the disassembly
should be more useful. For example, compare:
% objdump -d /usr/bin/xz
[...]
Disassembly of section .text:
00000000000036e0 <.text>:
36e0: f3 0f 1e fa endbr64
36e4: 41 56 push %r14
[...]
with:
% objdump -d --dwarf=follow-links /usr/bin/xz
[...]
Disassembly of section .text:
00000000000036e0 <main>:
36e0: f3 0f 1e fa endbr64
36e4: 41 56 push %r14
36e6: 41 55 push %r13
[...]
Cheers
Nick
binutils/ChangeLog
2019-02-25 Nick Clifton <nickc@redhat.com>
* objdump.c (sym_ok): New function.
(find_symbol_for_address): Use new function.
(disassemble_section): Compare sections by name, not pointer.
(dump_dwarf): Move code to initialise byte_get pointer and iterate
over separate debug files from here to ...
(dump_bfd): ... here. Add parameter indicating that a separate
debug info file is being dumped. For main file, pull in the
symbol tables from all separate debug info files.
(display_object): Update call to dump_bfd.
* doc/binutils.texi: Document extened behaviour of the
--dwarf=follow-links option.
* NEWS: Mention this new feature.
* testsuite/binutils-all/objdump.WK2: Update expected output.
* testsuite/binutils-all/objdump.exp (test_follow_debuglink): Add
options and dump file parameters.
Add extra test.
* testsuite/binutils-all/objdump.WK3: New file.
* testsuite/binutils-all/readelf.exp: Change expected output for
readelf -wKis test.
* testsuite/binutils-all/readelf.wKis: New file.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: objdump-follow-links.patch
Type: text/x-patch
Size: 17978 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20190225/3c9b107e/attachment.bin>
More information about the Binutils
mailing list