Load debug section only when dumping debug sections
authorH.J. Lu <hjl.tools@gmail.com>
Sun, 30 Jan 2022 17:17:56 +0000 (09:17 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 31 Jan 2022 18:16:49 +0000 (10:16 -0800)
commite1dbfc17c5305eef8f021c1baa703151bffc1490
treeecca0df32edcb737c8c323fc4f1a0f2f8893ed6c
parent492325c4b78933e41608c53963d29b1f16affd47
Load debug section only when dumping debug sections

Don't load debug sections if we aren't dumping any debug sections.

PR binutils/28843
* objdump.c (dump_any_debugging): New.
(load_debug_section): Return false if dump_any_debugging isn't
set.
(main): Set dump_any_debugging when dumping any debug sections.
* readelf (dump_any_debugging): New.
(parse_args): Set dump_any_debugging when dumping any debug
sections.
(load_debug_section): Return false if dump_any_debugging isn't
set.
binutils/objdump.c
binutils/readelf.c