aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2012-05-23 04:38:08 +0000
committerAlan Modra <amodra@gmail.com>2012-05-23 04:38:08 +0000
commit89b2bec8ac096eab3b9ec85a4141def240a46071 (patch)
tree5e941ff2d01805aaa74c2980878a63fbe879509e
parent259b427a20f9b3e772817401549b62c85bdbb56c (diff)
downloadgdb-89b2bec8ac096eab3b9ec85a4141def240a46071.zip
gdb-89b2bec8ac096eab3b9ec85a4141def240a46071.tar.gz
gdb-89b2bec8ac096eab3b9ec85a4141def240a46071.tar.bz2
* elf-eh-frame.c (_bfd_elf_maybe_strip_eh_frame_hdr): Handle
BFDs with multiple .eh_frame sections.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf-eh-frame.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index dd15034..5fe29db 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
2012-05-23 Alan Modra <amodra@gmail.com>
+ * elf-eh-frame.c (_bfd_elf_maybe_strip_eh_frame_hdr): Handle
+ BFDs with multiple .eh_frame sections.
+
+2012-05-23 Alan Modra <amodra@gmail.com>
+
PR ld/13909
* elflink.c (bfd_elf_discard_info): Don't ignore dynamic BFDs.
diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c
index 8ec34ab..685540c 100644
--- a/bfd/elf-eh-frame.c
+++ b/bfd/elf-eh-frame.c
@@ -1278,7 +1278,11 @@ _bfd_elf_maybe_strip_eh_frame_hdr (struct bfd_link_info *info)
/* Count only sections which have at least a single CIE or FDE.
There cannot be any CIE or FDE <= 8 bytes. */
o = bfd_get_section_by_name (abfd, ".eh_frame");
- if (o && o->size > 8 && !bfd_is_abs_section (o->output_section))
+ while (o != NULL
+ && (o->size <= 8
+ || bfd_is_abs_section (o->output_section)))
+ o = bfd_get_next_section_by_name (o);
+ if (o != NULL)
break;
}