objdump: don't cache section contents in load_specific_debug_section

* objdump.c (load_specific_debug_section): Don't call
	bfd_cache_section_contents.  Rearrange so that
	bfd_get_full_section_contents is not called on path where
	bfd_simple_get_relocated_section_contents is called.
	Don't set section->user_data.
	(free_debug_section): Always free section->start.  Don't twiddle
	section flags.
	* readelf.c (load_specific_debug_section): Don't set user_data.
	* dwarf.h (struct dwarf_section): Remove use_data field.
	* dwarf.c (NO_ABBREVS, ABBREV): Adjust to suit.
This commit is contained in:
Alan Modra 2021-02-15 12:04:11 +10:30
parent 1781a9d0f3
commit 208599d928
5 changed files with 44 additions and 61 deletions

View file

@ -11491,8 +11491,8 @@ dwarf_select_sections_all (void)
do_debug_str_offsets = 1;
}
#define NO_ABBREVS NULL, NULL, NULL, 0, 0, 0, NULL, 0, NULL
#define ABBREV(N) NULL, NULL, NULL, 0, 0, N, NULL, 0, NULL
#define NO_ABBREVS NULL, NULL, NULL, 0, 0, 0, NULL, 0
#define ABBREV(N) NULL, NULL, NULL, 0, 0, N, NULL, 0
/* N.B. The order here must match the order in section_display_enum. */