binutils-gdb/gdb/dwarf2
Tom Tromey 5d683ae3da Do not assume ELF in dwarf2/read.c
dwarf2/read.c has this code:

  else if (elf_section_data (sectp)->this_hdr.sh_size
	   > bfd_get_file_size (abfd))

This assumes that the BFD is an ELF, which is an invalid assumption.
A user noticed that this can sometimes cause a crash.

This patch fixes the problem by changing this code to use
bfd_section_size_insane.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32104
Reviewed-By: Tom de Vries <tdevries@suse.de>
Reviewed-by: Keith Seitz <keiths@redhat.com>
2024-08-21 10:33:46 -06:00
..
abbrev-cache.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
abbrev-cache.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
abbrev.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
abbrev.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
ada-imported.c gdb: add program_space parameter to lookup_minimal_symbol_linkage 2024-08-12 10:38:29 -04:00
aranges.c Remove call to dwarf2_per_objfile::adjust from ranges readers 2024-05-04 09:30:30 -06:00
aranges.h Remove addrmap_fixed::set_entry 2024-01-15 11:50:24 -07:00
attribute.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
attribute.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
call-site.h gdb: pass frames as const frame_info_ptr & 2024-02-20 10:42:25 -05:00
comp-unit-head.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
comp-unit-head.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
cooked-index.c gdb: remove unused includes in utils.h 2024-05-30 22:43:52 -04:00
cooked-index.h gdb: drop struct keyword when using bound_minimal_symbol 2024-08-12 10:31:09 -04:00
cu.c Prefer htab_traverse_noresize 2024-06-24 09:11:30 -06:00
cu.h Don't obstack-allocate the call site hash table 2024-06-24 09:11:30 -06:00
die.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
die.h gdb: don't include hashtab.h in defs.h 2024-04-22 21:34:19 -04:00
dwz.c gdb: ensure has dwarf info before reading DWZ file 2024-04-03 13:47:03 +01:00
dwz.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
expr.c gdb: move a bunch of quit-related things to event-top.{c,h} 2024-04-23 11:26:14 -04:00
expr.h gdb: pass frames as const frame_info_ptr & 2024-02-20 10:42:25 -05:00
file-and-dir.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
frame-tailcall.c gdb: remove unused includes in utils.h 2024-05-30 22:43:52 -04:00
frame-tailcall.h gdb: pass frames as const frame_info_ptr & 2024-02-20 10:42:25 -05:00
frame.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
frame.h gdb: pass frames as const frame_info_ptr & 2024-02-20 10:42:25 -05:00
index-cache.c gdb: add overloads of gdb_abspath 2024-06-27 15:15:25 +01:00
index-cache.h Move the 'store' method to index_cache_store_context 2024-03-08 17:25:50 -07:00
index-common.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
index-common.h gdb: don't include hashtab.h in defs.h 2024-04-22 21:34:19 -04:00
index-write.c gdb: remove unused includes in utils.h 2024-05-30 22:43:52 -04:00
index-write.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
leb.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
leb.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
line-header.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
line-header.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
loc.c gdb: add program_space parameter to lookup_minimal_symbol 2024-08-12 10:31:09 -04:00
loc.h gdb: pass frames as const frame_info_ptr & 2024-02-20 10:42:25 -05:00
macro.c [gdb/symtab] Emit malformed macro definition complaint once 2024-07-30 16:56:31 +02:00
macro.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
mapped-index.h Move dwarf2_per_bfd::index_addrmap to mapped_gdb_index 2024-05-31 08:26:05 -06:00
parent-map.h Introduce class parent_map for DIE range map 2024-04-16 11:54:46 -06:00
public.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
read-debug-names.c Correctly handle DIE parent computations 2024-04-16 11:54:46 -06:00
read-debug-names.h Export dwarf5_augmentation 2024-01-18 08:20:17 -07:00
read-gdb-index.c Move dwarf2_per_bfd::index_addrmap to mapped_gdb_index 2024-05-31 08:26:05 -06:00
read-gdb-index.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
read.c Do not assume ELF in dwarf2/read.c 2024-08-21 10:33:46 -06:00
read.h gdb: drop struct keyword when using bound_minimal_symbol 2024-08-12 10:31:09 -04:00
sect-names.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
section.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
section.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
stringify.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
stringify.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
tag.h Use the new symbol domains 2024-01-28 10:58:16 -07:00
types.h gdbsupport: constify some return values in print-utils.{h,cc} 2024-04-18 10:31:54 -04:00