Blob Blame History Raw
*** ../binutils-2.23.51.0.1.orig/bfd/elf64-ppc.c	2013-02-04 08:56:55.637750850 +0000
--- bfd/elf64-ppc.c	2013-02-04 08:57:52.024749066 +0000
*************** dec_dynrel_count (bfd_vma r_info,
*** 7053,7066 ****
  	  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;
      }
  
    while ((p = *pp) != NULL)
      {
        if (p->sec == sec)
--- 7053,7067 ----
  	  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.  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)