ELF: Properly handle section symbols
[deliverable/binutils-gdb.git] / bfd / elflink.c
index 60a3c2216f3f10f26c90ae3cccdb88fe65b74411..3e56a297f69833ca5c12df61e9fd7d721d33fb8d 100644 (file)
@@ -14802,12 +14802,16 @@ bfd_elf_define_start_stop (struct bfd_link_info *info,
 
   h = elf_link_hash_lookup (elf_hash_table (info), symbol,
                            FALSE, FALSE, TRUE);
+  /* NB: Common symbols will be turned into definition later.  */
   if (h != NULL
       && (h->root.type == bfd_link_hash_undefined
          || h->root.type == bfd_link_hash_undefweak
-         || ((h->ref_regular || h->def_dynamic) && !h->def_regular)))
+         || ((h->ref_regular || h->def_dynamic)
+             && !h->def_regular
+             && h->root.type != bfd_link_hash_common)))
     {
       bfd_boolean was_dynamic = h->ref_dynamic || h->def_dynamic;
+      h->verinfo.verdef = NULL;
       h->root.type = bfd_link_hash_defined;
       h->root.u.def.section = sec;
       h->root.u.def.value = 0;
This page took 0.035672 seconds and 4 git commands to generate.