Fix garbage collection of common symbols
[deliverable/binutils-gdb.git] / bfd / elflink.c
index f2ab71d58b78276bf048f0d69a971979d55a494e..26af87085d2ebfcf3398d50acdee59c7d630961c 100644 (file)
@@ -12113,7 +12113,7 @@ elf_gc_sweep_symbol (struct elf_link_hash_entry *h, void *data)
   if (!h->mark
       && (((h->root.type == bfd_link_hash_defined
            || h->root.type == bfd_link_hash_defweak)
-          && !(h->def_regular
+          && !((h->def_regular || ELF_COMMON_DEF_P (h))
                && h->root.u.def.section->gc_mark))
          || h->root.type == bfd_link_hash_undefined
          || h->root.type == bfd_link_hash_undefweak))
@@ -12336,7 +12336,7 @@ bfd_elf_gc_mark_dynamic_ref_symbol (struct elf_link_hash_entry *h, void *inf)
   if ((h->root.type == bfd_link_hash_defined
        || h->root.type == bfd_link_hash_defweak)
       && (h->ref_dynamic
-         || (h->def_regular
+         || ((h->def_regular || ELF_COMMON_DEF_P (h))
              && ELF_ST_VISIBILITY (h->other) != STV_INTERNAL
              && ELF_ST_VISIBILITY (h->other) != STV_HIDDEN
              && (!info->executable
This page took 0.026585 seconds and 4 git commands to generate.