* elflink.c (_bfd_elf_gc_mark_hook): New function.
[deliverable/binutils-gdb.git] / bfd / elf32-mcore.c
index e978cdc0051b6f0ad6b4e9df2b750cc4b84d456f..9034671c6e06ae8d4ad02acda4225ef9fbd3dc7e 100644 (file)
@@ -526,37 +526,21 @@ mcore_elf_relocate_section (bfd * output_bfd,
    relocation.  */
 
 static asection *
-mcore_elf_gc_mark_hook (asection *                   sec,
-                       struct bfd_link_info *       info ATTRIBUTE_UNUSED,
-                       Elf_Internal_Rela *          rel,
-                       struct elf_link_hash_entry * h,
-                       Elf_Internal_Sym *           sym)
+mcore_elf_gc_mark_hook (asection *sec,
+                       struct bfd_link_info *info,
+                       Elf_Internal_Rela *rel,
+                       struct elf_link_hash_entry *h,
+                       Elf_Internal_Sym *sym)
 {
-  if (h == NULL)
-    return bfd_section_from_elf_index (sec->owner, sym->st_shndx);
-
-  switch (ELF32_R_TYPE (rel->r_info))
-    {
-    case R_MCORE_GNU_VTINHERIT:
-    case R_MCORE_GNU_VTENTRY:
-      break;
-
-    default:
-      switch (h->root.type)
-       {
-       case bfd_link_hash_defined:
-       case bfd_link_hash_defweak:
-         return h->root.u.def.section;
-
-       case bfd_link_hash_common:
-         return h->root.u.c.p->section;
-
-       default:
-         break;
-       }
-    }
-
-  return NULL;
+  if (h != NULL)
+    switch (ELF32_R_TYPE (rel->r_info))
+      {
+      case R_MCORE_GNU_VTINHERIT:
+      case R_MCORE_GNU_VTENTRY:
+       return NULL;
+      }
+
+  return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
 }
 
 /* Update the got entry reference counts for the section being removed.  */
This page took 0.024221 seconds and 4 git commands to generate.