* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Drop
authorAlan Modra <amodra@gmail.com>
Mon, 21 Jul 2008 07:49:58 +0000 (07:49 +0000)
committerAlan Modra <amodra@gmail.com>
Mon, 21 Jul 2008 07:49:58 +0000 (07:49 +0000)
unwanted zero terminators.

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

index f00c73a6c6dfd1f83b0e8e26abb89afc52f99737..a81993d2cd100c548574e6ccaa2f7c232e6caffb 100644 (file)
@@ -1,3 +1,8 @@
+2008-07-21  Alan Modra  <amodra@bigpond.net.au>
+
+       * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Drop
+       unwanted zero terminators.
+
 2008-07-21  Alan Modra  <amodra@bigpond.net.au>
 
        * elf32-spu.c (spu_elf_relocate_section): Expand
index 087c6b0930aa00486ff6da759436b55fdcba23a9..9b88499e486fff0218f496adb37de3bcb6a0b32b 100644 (file)
@@ -1077,7 +1077,11 @@ _bfd_elf_discard_section_eh_frame
 
   hdr_info = &elf_hash_table (info)->eh_info;
   for (ent = sec_info->entry; ent < sec_info->entry + sec_info->count; ++ent)
-    if (!ent->cie)
+    if (ent->size == 4)
+      /* There should only be one zero terminator, on the last input
+        file supplying .eh_frame (crtend.o).  Remove any others.  */
+      ent->removed = sec->map_head.s != NULL;
+    else if (!ent->cie)
       {
        cookie->rel = cookie->rels + ent->reloc_index;
        BFD_ASSERT (cookie->rel < cookie->relend