* elf-eh-frame.c (_bfd_elf_maybe_strip_eh_frame_hdr): Handle
authorAlan Modra <amodra@gmail.com>
Wed, 23 May 2012 04:38:08 +0000 (04:38 +0000)
committerAlan Modra <amodra@gmail.com>
Wed, 23 May 2012 04:38:08 +0000 (04:38 +0000)
        BFDs with multiple .eh_frame sections.

bfd/ChangeLog
bfd/elf-eh-frame.c

index dd15034934fcfafedaf1f72fd784dc3a47db82db..5fe29dbc2dc889b21a90f249f353bcd5979c0146 100644 (file)
@@ -1,3 +1,8 @@
+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
index 8ec34ab0caba22bdd57ba821c55dd579b3b0ccdf..685540c91070a8b2418b12b75ce8b1bd2cc142b2 100644 (file)
@@ -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;
       }