ELF: Consolidate maybe_set_textrel
[deliverable/binutils-gdb.git] / bfd / elf32-ppc.c
index 588b79781d80acc85be4f9105781ecdf3625bbb5..0cb7f67504d4d4f56a4272f37d65f4f604a0f12c 100644 (file)
@@ -5423,33 +5423,6 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
   return TRUE;
 }
 
-/* Set DF_TEXTREL if we find any dynamic relocs that apply to
-   read-only sections.  */
-
-static bfd_boolean
-maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
-{
-  asection *sec;
-
-  if (h->root.type == bfd_link_hash_indirect)
-    return TRUE;
-
-  sec = _bfd_elf_readonly_dynrelocs (h);
-  if (sec != NULL)
-    {
-      struct bfd_link_info *info = (struct bfd_link_info *) info_p;
-
-      info->flags |= DF_TEXTREL;
-      info->callbacks->minfo
-       (_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"),
-        sec->owner, h->root.root.string, sec);
-
-      /* Not an error, just cut short the traversal.  */
-      return FALSE;
-    }
-  return TRUE;
-}
-
 static const unsigned char glink_eh_frame_cie[] =
 {
   0, 0, 0, 16,                         /* length.  */
@@ -5900,7 +5873,8 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd,
       /* If any dynamic relocs apply to a read-only section, then we
         need a DT_TEXTREL entry.  */
       if ((info->flags & DF_TEXTREL) == 0)
-       elf_link_hash_traverse (elf_hash_table (info), maybe_set_textrel,
+       elf_link_hash_traverse (elf_hash_table (info),
+                               _bfd_elf_maybe_set_textrel,
                                info);
 
       if ((info->flags & DF_TEXTREL) != 0)
This page took 0.02441 seconds and 4 git commands to generate.