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.
This commit is contained in:
Nick Clifton 2021-02-12 14:52:22 +00:00
parent 96df3e28b8
commit c46b706620
18 changed files with 183 additions and 47 deletions

View file

@ -4624,12 +4624,23 @@ usage (FILE * stream)
-R --relocated-dump=<number|name>\n\
Dump the contents of section <number|name> as relocated bytes\n\
-z --decompress Decompress section before dumping it\n\
-w[lLiaprmfFsoORtUuTgAckK] or\n\
-w[lLiaprmfFsoORtUuTgAck] or\n\
--debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,\n\
=frames-interp,=str,=str-offsets,=loc,=Ranges,=pubtypes,\n\
=gdb_index,=trace_info,=trace_abbrev,=trace_aranges,\n\
=addr,=cu_index,=links,=follow-links]\n\
=addr,=cu_index,=links]\n\
Display the contents of DWARF debug sections\n"));
#if DEFAULT_FOR_FOLLOW_LINKS
fprintf (stream, _("\
-wK,--debug-dump=follow-links Follow links to separate debug info files (default)\n\
-wN,--debug-dump=no-follow-links Do not follow links to separate debug info files\n\
"));
#else
fprintf (stream, _("\
-wK,--debug-dump=follow-links Follow links to separate debug info files\n\
-wN,--debug-dump=no-follow-links Do not follow links to separate debug info files (default)\n\
"));
#endif
fprintf (stream, _("\
--dwarf-depth=N Do not display DIEs at depth N or greater\n\
--dwarf-start=N Display DIEs starting with N, at the same depth\n\