From d85bf2ba86fea1cf918f065d179b98eb4ddbde86 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 21 Nov 2017 13:12:04 +0000 Subject: Add ability to follow dwo links to readelf/objdump. * dwarf.c (dwo_name, dwo_dir, dwo_id, dwo_id_len): New variables. (read_and_display_attr_value): Record dwo variables if requested. (display_augmentation_data): Rename to display_data and make generic. (load_dwo_file): New function. Loads a separate dwarf object file. (load_separate_debug_file): Add reporting and loading of separate dwarf objet files. * readelf.c (process_section_headers): Add do_debug_links to list of flags requiring a debug dump. (display_debug_section): Tidy up code. * doc/debug.options.texi: Add note that dwo links will also be followed. * testsuite/binutils-all/debuglink.s: Tidy code. * testsuite/binutils-all/dwo.s: New test file. * testsuite/binutils-all/readelf.wk2: New file - expected output from readelf. * testsuite/binutils-all/readelf.exp: Run the new test. --- binutils/doc/debug.options.texi | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'binutils/doc') diff --git a/binutils/doc/debug.options.texi b/binutils/doc/debug.options.texi index 9204b2b..5794565 100644 --- a/binutils/doc/debug.options.texi +++ b/binutils/doc/debug.options.texi @@ -45,7 +45,10 @@ output from this option can also be restricted by the use of the @item k @itemx =links Displays the contents of the @samp{.gnu_debuglink} and/or -@samp{.gnu_debugaltlink} sections. +@samp{.gnu_debugaltlink} sections. Also displays the link to a +separate dwarf object file (dwo), if one is specified by the +DW_AT_GNU_dwo_name or DW_AT_dwo_name attributes in the +@samp{.debug_info} section. @item K @itemx =follow-links @@ -55,9 +58,9 @@ versions of the same debug section being displayed if both the main file and the separate debug info file contain sections with the same name. -When displaying other debug information, if a link is encountered to -a separate debug info file, then attempt to follow the link and -display the referenced contents. +In addition, when displaying DWARF attributes, if a form is found that +references the separate debug info file, then the referenced contents +will also be displayed. @item l @itemx =rawline -- cgit v1.1