* elflink.c (_bfd_elf_gc_mark_hook): New function.
[deliverable/binutils-gdb.git] / bfd / elf32-score.c
index 779375416c673d46415d56984b6b37ff14eacf7a..60a1a200274850bca19402cc9237fad76fb59708 100644 (file)
@@ -3616,40 +3616,25 @@ _bfd_score_elf_ignore_discarded_relocs (asection *sec)
   return FALSE;
 }
 
-/* This function discover the section a particular relocation refers to.
-   Return the section that should be marked against GC for a given relocation.  */
+/* Return the section that should be marked against GC for a given
+   relocation.  */
 
 static asection *
 _bfd_score_elf_gc_mark_hook (asection *sec,
-                            struct bfd_link_info *info ATTRIBUTE_UNUSED,
+                            struct bfd_link_info *info,
                             Elf_Internal_Rela *rel,
                             struct elf_link_hash_entry *h,
                             Elf_Internal_Sym *sym)
 {
   if (h != NULL)
-    {
-      switch (ELF32_R_TYPE (rel->r_info))
-        {
-        case R_SCORE_GNU_VTINHERIT:
-        case R_SCORE_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;
-            }
-        }
-    }
-  else
-    return bfd_section_from_elf_index (sec->owner, sym->st_shndx);
+    switch (ELF32_R_TYPE (rel->r_info))
+      {
+      case R_SCORE_GNU_VTINHERIT:
+      case R_SCORE_GNU_VTENTRY:
+       return NULL;
+      }
 
-  return NULL;
+  return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
 }
 
 /* Support for core dump NOTE sections.  */
This page took 0.023992 seconds and 4 git commands to generate.