From: Jan Kratochvil Date: Wed, 8 Sep 2010 19:49:28 +0000 (+0000) Subject: gdb/ X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=824308520bc62a9a5f72d89c7c821183e34f39f6;p=binutils-gdb.git gdb/ * dwarf2read.c (dwarf2_read_index): Return on no SEC_HAS_CONTENTS. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 45eb3e701ee..71a63f0f0e2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2010-09-08 Jan Kratochvil + + * dwarf2read.c (dwarf2_read_index): Return on no SEC_HAS_CONTENTS. + 2010-09-08 Daniel Jacobowitz * dwarf2read.c (read_structure_type): Move processing of diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index b7d3b216bf3..1379f72587e 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -1904,6 +1904,13 @@ dwarf2_read_index (struct objfile *objfile) if (dwarf2_per_objfile->gdb_index.asection == NULL || dwarf2_per_objfile->gdb_index.size == 0) return 0; + + /* Older elfutils strip versions could keep the section in the main + executable while splitting it for the separate debug info file. */ + if ((bfd_get_file_flags (dwarf2_per_objfile->gdb_index.asection) + & SEC_HAS_CONTENTS) == 0) + return 0; + dwarf2_read_section (objfile, &dwarf2_per_objfile->gdb_index); addr = dwarf2_per_objfile->gdb_index.buffer;