From 62175893fe92b9d83d6c0ddb82f420a25fdc0f01 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Mon, 27 Aug 2012 16:42:55 +0000 Subject: [PATCH] gdb/ PR gdb/14494. * dwarf2read.c (dwarf2_locate_sections): Move variable aflag here. Move the SEC_HAS_CONTENTS check here - for any NAMES use. (dwarf2_locate_sections) : Move the variable and check from here. --- gdb/ChangeLog | 8 ++++++++ gdb/dwarf2read.c | 15 +++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 12083ac03bf..d74486ffb2a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2012-08-27 Jan Kratochvil + + PR gdb/14494. + * dwarf2read.c (dwarf2_locate_sections): Move variable aflag here. + Move the SEC_HAS_CONTENTS check here - for any NAMES use. + (dwarf2_locate_sections) : Move the variable and check from + here. + 2012-08-22 Keith Seitz * defs.h: Include build-gnulib/config.h diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index deee5a297c4..48b8c08ae63 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -1691,13 +1691,17 @@ static void dwarf2_locate_sections (bfd *abfd, asection *sectp, void *vnames) { const struct dwarf2_debug_sections *names; + flagword aflag = bfd_get_section_flags (abfd, sectp); if (vnames == NULL) names = &dwarf2_elf_names; else names = (const struct dwarf2_debug_sections *) vnames; - if (section_is_p (sectp->name, &names->info)) + if ((aflag & SEC_HAS_CONTENTS) == 0) + { + } + else if (section_is_p (sectp->name, &names->info)) { dwarf2_per_objfile->info.asection = sectp; dwarf2_per_objfile->info.size = bfd_get_section_size (sectp); @@ -1744,13 +1748,8 @@ dwarf2_locate_sections (bfd *abfd, asection *sectp, void *vnames) } else if (section_is_p (sectp->name, &names->eh_frame)) { - flagword aflag = bfd_get_section_flags (abfd, sectp); - - if (aflag & SEC_HAS_CONTENTS) - { - dwarf2_per_objfile->eh_frame.asection = sectp; - dwarf2_per_objfile->eh_frame.size = bfd_get_section_size (sectp); - } + dwarf2_per_objfile->eh_frame.asection = sectp; + dwarf2_per_objfile->eh_frame.size = bfd_get_section_size (sectp); } else if (section_is_p (sectp->name, &names->ranges)) { -- 2.47.2