]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* elf64-ppc.c (dec_dynrel_count): Don't error when elf_gc_sweep_symbol
authorAlan Modra <amodra@gmail.com>
Fri, 1 Feb 2013 11:48:07 +0000 (11:48 +0000)
committerAlan Modra <amodra@gmail.com>
Fri, 1 Feb 2013 11:48:07 +0000 (11:48 +0000)
clears def_regular.

bfd/ChangeLog
bfd/elf64-ppc.c

index e103fbf4558d8ffb4858961ff71e627b02ae0d3b..17505e21868b9788275898c6bd30beaa256aa62c 100644 (file)
@@ -1,3 +1,8 @@
+2013-02-01  Alan Modra  <amodra@gmail.com>
+
+       * elf64-ppc.c (dec_dynrel_count): Don't error when elf_gc_sweep_symbol
+       clears def_regular.
+
 2013-01-31  Alan Modra  <amodra@gmail.com>
            David S. Miller  <davem@davemloft.net>
 
index 23c6849724cd99c3383565879ca75c10d01d307c..37775eb435317896a119a84983ec6c928fcd2d29 100644 (file)
@@ -7053,14 +7053,15 @@ dec_dynrel_count (bfd_vma r_info,
          void *vpp = &elf_section_data (sec)->local_dynrel;
          pp = (struct elf_dyn_relocs **) vpp;
        }
-
-      /* elf_gc_sweep may have already removed all dyn relocs associated
-        with local syms for a given section.  Don't report a dynreloc
-        miscount.  */
-      if (*pp == NULL)
-       return TRUE;
     }
 
+  /* elf_gc_sweep may have already removed all dyn relocs associated
+     with local syms for a given section.  Also, symbol flags are
+     changed by elf_gc_sweep_symbol, confusing the test above.  Don't
+     report a dynreloc miscount.  */
+  if (*pp == NULL && info->gc_sections)
+    return TRUE;
+
   while ((p = *pp) != NULL)
     {
       if (p->sec == sec)