]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix check_relocs/gc_sweep_hook mismatch
authorAlan Modra <amodra@gmail.com>
Fri, 28 Feb 2014 04:08:27 +0000 (14:38 +1030)
committerRoland McGrath <mcgrathr@google.com>
Thu, 6 Mar 2014 17:50:52 +0000 (09:50 -0800)
PR ld/16643
* elflink.c (elf_gc_sweep): Call gc_sweep_hook for exactly
the same conditions we called check_relocs.

(cherry picked from commit 9850436d9e423d66d67d27135896582b2725782e)

bfd/ChangeLog
bfd/elflink.c

index 0e835c57e18c526ea9added70ea98e6f0f5dab7e..ee617881ed1fe880c56b5b6e280e463387f848c2 100644 (file)
@@ -1,3 +1,9 @@
+2014-02-28  Alan Modra  <amodra@gmail.com>
+
+       PR ld/16643
+       * elflink.c (elf_gc_sweep): Call gc_sweep_hook for exactly
+       the same conditions we called check_relocs.
+
 2014-02-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * cache.c (bfd_cache_max_open): Cast RLIM_INFINITY to rlim_t.
index 742996dfc546d9489efaa01c22739a36f2edc9d6..d1bc23440303c9e9f351f4151b11a49a16cebb4c 100644 (file)
@@ -11979,7 +11979,9 @@ elf_gc_sweep (bfd *abfd, struct bfd_link_info *info)
             info we collected before.  */
          if (gc_sweep_hook
              && (o->flags & SEC_RELOC) != 0
-             && o->reloc_count > 0
+             && o->reloc_count != 0
+             && !((info->strip == strip_all || info->strip == strip_debugger)
+                  && (o->flags & SEC_DEBUGGING) != 0)
              && !bfd_is_abs_section (o->output_section))
            {
              Elf_Internal_Rela *internal_relocs;