ELF: Consolidate readonly_dynrelocs
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 3 Jun 2020 14:00:55 +0000 (07:00 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 3 Jun 2020 14:01:13 +0000 (07:01 -0700)
All readonly_dynrelocs implementations are the same.  Consolidate them
to a single _bfd_elf_readonly_dynrelocs.

PR ld/26067
* elf-bfd.h (_bfd_elf_readonly_dynrelocs): New.
* elf32-arm.c (readonly_dynrelocs): Removed.
(maybe_set_textrel): Replace readonly_dynrelocs with
_bfd_elf_readonly_dynrelocs.
* elf32-csky.c (readonly_dynrelocs): Removed.
(maybe_set_textrel): Replace readonly_dynrelocs with
_bfd_elf_readonly_dynrelocs.
*  elf32-hppa.c(readonly_dynrelocs): Removed.
(alias_readonly_dynrelocs): Replace readonly_dynrelocs with
_bfd_elf_readonly_dynrelocs.
(maybe_set_textrel): Likewise.
* elf32-lm32.c (readonly_dynrelocs): Removed.
(lm32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
with _bfd_elf_readonly_dynrelocs.
(maybe_set_textrel): Likewise.
* elf32-m32r.c (readonly_dynrelocs): Removed.
(m32r_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
with _bfd_elf_readonly_dynrelocs.
(maybe_set_textrel): Likewise.
* elf32-metag.c (readonly_dynrelocs): Removed.
(elf_metag_adjust_dynamic_symbol): Replace readonly_dynrelocs
with _bfd_elf_readonly_dynrelocs.
(maybe_set_textrel): Likewise.
* elf32-microblaze.c (readonly_dynrelocs): Removed.
(microblaze_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
with _bfd_elf_readonly_dynrelocs.
* elf32-nds32.c (readonly_dynrelocs): Removed.
(nds32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
with _bfd_elf_readonly_dynrelocs.
(maybe_set_textrel): Likewise.
* elf32-or1k.c (readonly_dynrelocs): Removed.
(or1k_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
with _bfd_elf_readonly_dynrelocs.
* elf32-ppc.c (readonly_dynrelocs): Removed.
(alias_readonly_dynrelocs): Replace readonly_dynrelocs with
_bfd_elf_readonly_dynrelocs.
(ppc_elf_adjust_dynamic_symbol): Likewise.
(maybe_set_textrel): Likewise.
* elf32-s390.c (readonly_dynrelocs): Removed.
(elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
with _bfd_elf_readonly_dynrelocs.
(maybe_set_textrel): Likewise.
* elf32-sh.c (readonly_dynrelocs): Removed.
(sh_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs with
_bfd_elf_readonly_dynrelocs.
(maybe_set_textrel): Likewise.
* elf32-tic6x.c (readonly_dynrelocs): Removed.
(maybe_set_textrel): Replace readonly_dynrelocs with
_bfd_elf_readonly_dynrelocs.
* elf32-tilepro.c (readonly_dynrelocs): Removed.
(tilepro_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
with _bfd_elf_readonly_dynrelocs.
(maybe_set_textrel): Likewise.
* elf64-ppc.c (readonly_dynrelocs): Removed.
(alias_readonly_dynrelocs): Replace readonly_dynrelocs with
_bfd_elf_readonly_dynrelocs.
(ppc64_elf_adjust_dynamic_symbol): Likewise.
(maybe_set_textrel): Likewise.
* elf64-s390.c (readonly_dynrelocs): Removed.
(elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
with _bfd_elf_readonly_dynrelocs.
(maybe_set_textrel): Likewise.
* elflink.c (_bfd_elf_readonly_dynrelocs): New.
* elfnn-aarch64.c (readonly_dynrelocs): Removed.
(maybe_set_textrel): Replace readonly_dynrelocs with
_bfd_elf_readonly_dynrelocs.
* elfnn-riscv.c (readonly_dynrelocs): Removed.
(riscv_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
with _bfd_elf_readonly_dynrelocs.
(maybe_set_textrel): Likewise.
* elfxx-sparc.c (readonly_dynrelocs): Removed.
(_bfd_sparc_elf_adjust_dynamic_symbol): Replace
readonly_dynrelocs with _bfd_elf_readonly_dynrelocs.
(maybe_set_textrel): Likewise.
* elfxx-tilegx.c (readonly_dynrelocs): Removed.
(tilegx_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
with _bfd_elf_readonly_dynrelocs.
(maybe_set_textrel): Likewise.
* elfxx-x86.c (readonly_dynrelocs): Removed.
(maybe_set_textrel): Replace readonly_dynrelocs with
_bfd_elf_readonly_dynrelocs.
(_bfd_x86_elf_adjust_dynamic_symbol): Likewise.

24 files changed:
bfd/ChangeLog
bfd/elf-bfd.h
bfd/elf32-arm.c
bfd/elf32-csky.c
bfd/elf32-hppa.c
bfd/elf32-lm32.c
bfd/elf32-m32r.c
bfd/elf32-metag.c
bfd/elf32-microblaze.c
bfd/elf32-nds32.c
bfd/elf32-or1k.c
bfd/elf32-ppc.c
bfd/elf32-s390.c
bfd/elf32-sh.c
bfd/elf32-tic6x.c
bfd/elf32-tilepro.c
bfd/elf64-ppc.c
bfd/elf64-s390.c
bfd/elflink.c
bfd/elfnn-aarch64.c
bfd/elfnn-riscv.c
bfd/elfxx-sparc.c
bfd/elfxx-tilegx.c
bfd/elfxx-x86.c

index 2fa19f8130d756dfb43fffcdd0788a1f68a0cab0..64f01ef5ef6a5adba03f7f168c5aae0efd236956 100644 (file)
@@ -1,3 +1,89 @@
+2020-06-03  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR ld/26067
+       * elf-bfd.h (_bfd_elf_readonly_dynrelocs): New.
+       * elf32-arm.c (readonly_dynrelocs): Removed.
+       (maybe_set_textrel): Replace readonly_dynrelocs with
+       _bfd_elf_readonly_dynrelocs.
+       * elf32-csky.c (readonly_dynrelocs): Removed.
+       (maybe_set_textrel): Replace readonly_dynrelocs with
+       _bfd_elf_readonly_dynrelocs.
+       *  elf32-hppa.c(readonly_dynrelocs): Removed.
+       (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
+       _bfd_elf_readonly_dynrelocs.
+       (maybe_set_textrel): Likewise.
+       * elf32-lm32.c (readonly_dynrelocs): Removed.
+       (lm32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
+       with _bfd_elf_readonly_dynrelocs.
+       (maybe_set_textrel): Likewise.
+       * elf32-m32r.c (readonly_dynrelocs): Removed.
+       (m32r_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
+       with _bfd_elf_readonly_dynrelocs.
+       (maybe_set_textrel): Likewise.
+       * elf32-metag.c (readonly_dynrelocs): Removed.
+       (elf_metag_adjust_dynamic_symbol): Replace readonly_dynrelocs
+       with _bfd_elf_readonly_dynrelocs.
+       (maybe_set_textrel): Likewise.
+       * elf32-microblaze.c (readonly_dynrelocs): Removed.
+       (microblaze_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
+       with _bfd_elf_readonly_dynrelocs.
+       * elf32-nds32.c (readonly_dynrelocs): Removed.
+       (nds32_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
+       with _bfd_elf_readonly_dynrelocs.
+       (maybe_set_textrel): Likewise.
+       * elf32-or1k.c (readonly_dynrelocs): Removed.
+       (or1k_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
+       with _bfd_elf_readonly_dynrelocs.
+       * elf32-ppc.c (readonly_dynrelocs): Removed.
+       (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
+       _bfd_elf_readonly_dynrelocs.
+       (ppc_elf_adjust_dynamic_symbol): Likewise.
+       (maybe_set_textrel): Likewise.
+       * elf32-s390.c (readonly_dynrelocs): Removed.
+       (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
+       with _bfd_elf_readonly_dynrelocs.
+       (maybe_set_textrel): Likewise.
+       * elf32-sh.c (readonly_dynrelocs): Removed.
+       (sh_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs with
+       _bfd_elf_readonly_dynrelocs.
+       (maybe_set_textrel): Likewise.
+       * elf32-tic6x.c (readonly_dynrelocs): Removed.
+       (maybe_set_textrel): Replace readonly_dynrelocs with
+       _bfd_elf_readonly_dynrelocs.
+       * elf32-tilepro.c (readonly_dynrelocs): Removed.
+       (tilepro_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
+       with _bfd_elf_readonly_dynrelocs.
+       (maybe_set_textrel): Likewise.
+       * elf64-ppc.c (readonly_dynrelocs): Removed.
+       (alias_readonly_dynrelocs): Replace readonly_dynrelocs with
+       _bfd_elf_readonly_dynrelocs.
+       (ppc64_elf_adjust_dynamic_symbol): Likewise.
+       (maybe_set_textrel): Likewise.
+       * elf64-s390.c (readonly_dynrelocs): Removed.
+       (elf_s390_adjust_dynamic_symbol): Replace readonly_dynrelocs
+       with _bfd_elf_readonly_dynrelocs.
+       (maybe_set_textrel): Likewise.
+       * elflink.c (_bfd_elf_readonly_dynrelocs): New.
+       * elfnn-aarch64.c (readonly_dynrelocs): Removed.
+       (maybe_set_textrel): Replace readonly_dynrelocs with
+       _bfd_elf_readonly_dynrelocs.
+       * elfnn-riscv.c (readonly_dynrelocs): Removed.
+       (riscv_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
+       with _bfd_elf_readonly_dynrelocs.
+       (maybe_set_textrel): Likewise.
+       * elfxx-sparc.c (readonly_dynrelocs): Removed.
+       (_bfd_sparc_elf_adjust_dynamic_symbol): Replace
+       readonly_dynrelocs with _bfd_elf_readonly_dynrelocs.
+       (maybe_set_textrel): Likewise.
+       * elfxx-tilegx.c (readonly_dynrelocs): Removed.
+       (tilegx_elf_adjust_dynamic_symbol): Replace readonly_dynrelocs
+       with _bfd_elf_readonly_dynrelocs.
+       (maybe_set_textrel): Likewise.
+       * elfxx-x86.c (readonly_dynrelocs): Removed.
+       (maybe_set_textrel): Replace readonly_dynrelocs with
+       _bfd_elf_readonly_dynrelocs.
+       (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
+
 2020-06-03  H.J. Lu  <hongjiu.lu@intel.com>
 
        * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Silence
index a979ad3f7b6e5e889a9631d0a1f1d7d9861cd184..6b8b5660fb77c8d19fd9c128b2b0ea45cd5aeb61 100644 (file)
@@ -2874,6 +2874,8 @@ extern bfd_boolean _bfd_elf_write_secondary_reloc_section
 extern unsigned int _bfd_elf_symbol_section_index
   (bfd *, elf_symbol_type *);
 
+extern asection *_bfd_elf_readonly_dynrelocs
+  (struct elf_link_hash_entry *);
 
 /* Large common section.  */
 extern asection _bfd_elf_large_com_section;
index f31eb8c9c70ed09a06ba4783e80d89b04c79632f..69d3ba16eebb1d7f413452267e128c10ab399cea 100644 (file)
@@ -16089,23 +16089,6 @@ elf32_arm_find_inliner_info (bfd *         abfd,
   return found;
 }
 
-/* Find dynamic relocs for H that apply to read-only sections.  */
-
-static asection *
-readonly_dynrelocs (struct elf_link_hash_entry *h)
-{
-  struct elf_dyn_relocs *p;
-
-  for (p = h->dyn_relocs; p != NULL; p = p->next)
-    {
-      asection *s = p->sec->output_section;
-
-      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-       return p->sec;
-    }
-  return NULL;
-}
-
 /* Adjust a symbol defined by a dynamic object and referenced by a
    regular object.  The current definition is in some section of the
    dynamic object, but we're not including those sections.  We have to
@@ -16730,7 +16713,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
   if (h->root.type == bfd_link_hash_indirect)
     return TRUE;
 
-  sec = readonly_dynrelocs (h);
+  sec = _bfd_elf_readonly_dynrelocs (h);
   if (sec != NULL)
     {
       struct bfd_link_info *info = (struct bfd_link_info *) info_p;
index 4be7ea8aa60304a230cf51a93f44e132ed6f9db3..52708702a6507cf66f6cd485d49295a0adf6849f 100644 (file)
@@ -1893,21 +1893,6 @@ csky_allocate_dynrelocs (struct elf_link_hash_entry *h, PTR inf)
   return TRUE;
 }
 
-static asection *
-readonly_dynrelocs (struct elf_link_hash_entry *h)
-{
-  struct elf_dyn_relocs *p;
-
-  for (p = h->dyn_relocs; p != NULL; p = p->next)
-    {
-      asection *s = p->sec->output_section;
-
-      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-       return p->sec;
-    }
-  return NULL;
-}
-
 /* Set DF_TEXTREL if we find any dynamic relocs that apply to
    read-only sections.  */
 
@@ -1919,7 +1904,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
   if (h->root.type == bfd_link_hash_indirect)
     return TRUE;
 
-  sec = readonly_dynrelocs (h);
+  sec = _bfd_elf_readonly_dynrelocs (h);
   if (sec != NULL)
     {
       struct bfd_link_info *info = (struct bfd_link_info *) info_p;
index ef32ba75cde142cfe9d805859e6178f1231642fe..15100431c8eb26459bf5da2aae7abf4bfa6637b7 100644 (file)
@@ -1654,23 +1654,6 @@ elf32_hppa_hide_symbol (struct bfd_link_info *info,
     }
 }
 
-/* Find any dynamic relocs that apply to read-only sections.  */
-
-static asection *
-readonly_dynrelocs (struct elf_link_hash_entry *eh)
-{
-  struct elf_dyn_relocs *hdh_p;
-
-  for (hdh_p = eh->dyn_relocs; hdh_p != NULL; hdh_p = hdh_p->next)
-    {
-      asection *sec = hdh_p->sec->output_section;
-
-      if (sec != NULL && (sec->flags & SEC_READONLY) != 0)
-       return hdh_p->sec;
-    }
-  return NULL;
-}
-
 /* Return true if we have dynamic relocs against H or any of its weak
    aliases, that apply to read-only sections.  Cannot be used after
    size_dynamic_sections.  */
@@ -1681,7 +1664,7 @@ alias_readonly_dynrelocs (struct elf_link_hash_entry *eh)
   struct elf32_hppa_link_hash_entry *hh = hppa_elf_hash_entry (eh);
   do
     {
-      if (readonly_dynrelocs (&hh->eh))
+      if (_bfd_elf_readonly_dynrelocs (&hh->eh))
        return TRUE;
       hh = hppa_elf_hash_entry (hh->eh.u.alias);
     } while (hh != NULL && &hh->eh != eh);
@@ -2106,7 +2089,7 @@ maybe_set_textrel (struct elf_link_hash_entry *eh, void *inf)
   if (eh->root.type == bfd_link_hash_indirect)
     return TRUE;
 
-  sec = readonly_dynrelocs (eh);
+  sec = _bfd_elf_readonly_dynrelocs (eh);
   if (sec != NULL)
     {
       struct bfd_link_info *info = (struct bfd_link_info *) inf;
index 0fe09bf44a0dd6b3252857b79b1afb72c6c7375d..9e958617f80fd89f0195f948b953094acc0b6700 100644 (file)
@@ -1599,23 +1599,6 @@ lm32_elf_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
     }
 }
 
-/* Find dynamic relocs for H that apply to read-only sections.  */
-
-static asection *
-readonly_dynrelocs (struct elf_link_hash_entry *h)
-{
-  struct elf_dyn_relocs *p;
-
-  for (p = h->dyn_relocs; p != NULL; p = p->next)
-    {
-      asection *s = p->sec->output_section;
-
-      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-       return p->sec;
-    }
-  return NULL;
-}
-
 /* Adjust a symbol defined by a dynamic object and referenced by a
    regular object.  The current definition is in some section of the
    dynamic object, but we're not including those sections.  We have to
@@ -1702,7 +1685,7 @@ lm32_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   /* If we don't find any dynamic relocs in read-only sections, then
      we'll be keeping the dynamic relocs and avoiding the copy reloc.  */
-  if (0 && !readonly_dynrelocs (h))
+  if (0 && !_bfd_elf_readonly_dynrelocs (h))
     {
       h->non_got_ref = 0;
       return TRUE;
@@ -1942,7 +1925,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
   if (h->root.type == bfd_link_hash_indirect)
     return TRUE;
 
-  sec = readonly_dynrelocs (h);
+  sec = _bfd_elf_readonly_dynrelocs (h);
   if (sec != NULL)
     {
       struct bfd_link_info *info = (struct bfd_link_info *) info_p;
index c147b713de360e73293a5fb0974ff037ec34b2f6..f719a532d466cf810e3c5203c0382950195bc1f7 100644 (file)
@@ -1700,23 +1700,6 @@ m32r_elf_copy_indirect_symbol (struct bfd_link_info *info,
 }
 
 \f
-/* Find dynamic relocs for H that apply to read-only sections.  */
-
-static asection *
-readonly_dynrelocs (struct elf_link_hash_entry *h)
-{
-  struct elf_dyn_relocs *p;
-
-  for (p = h->dyn_relocs; p != NULL; p = p->next)
-    {
-      asection *s = p->sec->output_section;
-
-      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-       return p->sec;
-    }
-  return NULL;
-}
-
 /* Adjust a symbol defined by a dynamic object and referenced by a
    regular object.  The current definition is in some section of the
    dynamic object, but we're not including those sections.  We have to
@@ -1807,7 +1790,7 @@ m32r_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   /* If we don't find any dynamic relocs in read-only sections, then
      we'll be keeping the dynamic relocs and avoiding the copy reloc.  */
-  if (0 && !readonly_dynrelocs (h))
+  if (0 && !_bfd_elf_readonly_dynrelocs (h))
     {
       h->non_got_ref = 0;
       return TRUE;
@@ -2047,7 +2030,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
   if (h->root.type == bfd_link_hash_indirect)
     return TRUE;
 
-  sec = readonly_dynrelocs (h);
+  sec = _bfd_elf_readonly_dynrelocs (h);
   if (sec != NULL)
     {
       struct bfd_link_info *info = (struct bfd_link_info *) info_p;
index bfd4b24f5f20311f0c921911386cbea321f15f21..b2cb918d4c856ef2350e14c4df31bf4878f81e14 100644 (file)
@@ -2435,23 +2435,6 @@ elf_metag_copy_indirect_symbol (struct bfd_link_info *info,
   _bfd_elf_link_hash_copy_indirect (info, eh_dir, eh_ind);
 }
 
-/* Find dynamic relocs for H that apply to read-only sections.  */
-
-static asection *
-readonly_dynrelocs (struct elf_link_hash_entry *h)
-{
-  struct elf_dyn_relocs *p;
-
-  for (p = h->dyn_relocs; p != NULL; p = p->next)
-    {
-      asection *s = p->sec->output_section;
-
-      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-       return p->sec;
-    }
-  return NULL;
-}
-
 /* Adjust a symbol defined by a dynamic object and referenced by a
    regular object.  The current definition is in some section of the
    dynamic object, but we're not including those sections.  We have to
@@ -2527,7 +2510,7 @@ elf_metag_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   /* If we don't find any dynamic relocs in read-only sections, then
      we'll be keeping the dynamic relocs and avoiding the copy reloc.  */
-  if (!readonly_dynrelocs (eh))
+  if (!_bfd_elf_readonly_dynrelocs (eh))
     {
       eh->non_got_ref = 0;
       return TRUE;
@@ -2778,7 +2761,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
   if (h->root.type == bfd_link_hash_indirect)
     return TRUE;
 
-  sec = readonly_dynrelocs (h);
+  sec = _bfd_elf_readonly_dynrelocs (h);
   if (sec != NULL)
     {
       struct bfd_link_info *info = (struct bfd_link_info *) info_p;
index 928098d2be20460e6abada66f9c880f5b65c5c71..92c5e7c30314552a26f6e054738f26082c911873 100644 (file)
@@ -2614,23 +2614,6 @@ microblaze_elf_copy_indirect_symbol (struct bfd_link_info *info,
   _bfd_elf_link_hash_copy_indirect (info, dir, ind);
 }
 
-/* Find dynamic relocs for H that apply to read-only sections.  */
-
-static asection *
-readonly_dynrelocs (struct elf_link_hash_entry *h)
-{
-  struct elf_dyn_relocs *p;
-
-  for (p = h->dyn_relocs; p != NULL; p = p->next)
-    {
-      asection *s = p->sec->output_section;
-
-      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-       return p->sec;
-    }
-  return NULL;
-}
-
 static bfd_boolean
 microblaze_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
                                      struct elf_link_hash_entry *h)
@@ -2709,7 +2692,7 @@ microblaze_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   /* If we don't find any dynamic relocs in read-only sections, then
      we'll be keeping the dynamic relocs and avoiding the copy reloc.  */
-  if (!readonly_dynrelocs (h))
+  if (!_bfd_elf_readonly_dynrelocs (h))
     {
       h->non_got_ref = 0;
       return TRUE;
index ee4eea7372ffc98989953c64ae86ce770962f7ab..ad5225fcd7cd2395163c1cba0858c698c10acae0 100644 (file)
@@ -3920,24 +3920,6 @@ nds32_elf_copy_indirect_symbol (struct bfd_link_info *info,
   _bfd_elf_link_hash_copy_indirect (info, dir, ind);
 }
 \f
-
-/* Find dynamic relocs for H that apply to read-only sections.  */
-
-static asection *
-readonly_dynrelocs (struct elf_link_hash_entry *h)
-{
-  struct elf_dyn_relocs *p;
-
-  for (p = h->dyn_relocs; p != NULL; p = p->next)
-    {
-      asection *s = p->sec->output_section;
-
-      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-       return p->sec;
-    }
-  return NULL;
-}
-
 /* Adjust a symbol defined by a dynamic object and referenced by a
    regular object.  The current definition is in some section of the
    dynamic object, but we're not including those sections.  We have to
@@ -4023,7 +4005,7 @@ nds32_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   /* If we don't find any dynamic relocs in read-only sections, then
      we'll be keeping the dynamic relocs and avoiding the copy reloc.  */
-  if (!readonly_dynrelocs (h))
+  if (!_bfd_elf_readonly_dynrelocs (h))
     {
       h->non_got_ref = 0;
       return TRUE;
@@ -4315,7 +4297,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
   if (h->root.type == bfd_link_hash_indirect)
     return TRUE;
 
-  sec = readonly_dynrelocs (h);
+  sec = _bfd_elf_readonly_dynrelocs (h);
   if (sec != NULL)
     {
       struct bfd_link_info *info = (struct bfd_link_info *) info_p;
index 7afde7a59a6201c3fa325f796c899bf8215098ca..01556266c109bf2f32f1d5630c49b962edb57c5b 100644 (file)
@@ -2547,25 +2547,6 @@ or1k_elf_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
     }
 }
 
-/* Find dynamic relocs for H that apply to read-only sections.  */
-
-static asection *
-readonly_dynrelocs (struct elf_link_hash_entry *h)
-{
-  struct elf_dyn_relocs *sec_relocs;
-
-  for (sec_relocs = h->dyn_relocs;
-       sec_relocs != NULL;
-       sec_relocs = sec_relocs->next)
-    {
-      asection *s = sec_relocs->sec->output_section;
-
-      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-       return sec_relocs->sec;
-    }
-  return NULL;
-}
-
 /* Adjust a symbol defined by a dynamic object and referenced by a
    regular object.  The current definition is in some section of the
    dynamic object, but we're not including those sections.  We have to
@@ -2652,7 +2633,7 @@ or1k_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   /* If we don't find any dynamic relocs in read-only sections, then
      we'll be keeping the dynamic relocs and avoiding the copy reloc.  */
-  if (!readonly_dynrelocs (h))
+  if (!_bfd_elf_readonly_dynrelocs (h))
     {
       h->non_got_ref = 0;
       return TRUE;
@@ -2949,7 +2930,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
   if (h->root.type == bfd_link_hash_indirect)
     return TRUE;
 
-  sec = readonly_dynrelocs (h);
+  sec = _bfd_elf_readonly_dynrelocs (h);
   if (sec != NULL)
     {
       struct bfd_link_info *info = (struct bfd_link_info *) info_p;
index eecb15f0bc1cf1d340127b7fe30e6eb7c1c0a033..588b79781d80acc85be4f9105781ecdf3625bbb5 100644 (file)
@@ -4694,23 +4694,6 @@ ppc_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED,
   return TRUE;
 }
 \f
-/* Find dynamic relocs for H that apply to read-only sections.  */
-
-static asection *
-readonly_dynrelocs (struct elf_link_hash_entry *h)
-{
-  struct elf_dyn_relocs *p;
-
-  for (p = h->dyn_relocs; p != NULL; p = p->next)
-    {
-      asection *s = p->sec->output_section;
-
-      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-       return p->sec;
-    }
-  return NULL;
-}
-
 /* Return true if we have dynamic relocs against H or any of its weak
    aliases, that apply to read-only sections.  Cannot be used after
    size_dynamic_sections.  */
@@ -4721,7 +4704,7 @@ alias_readonly_dynrelocs (struct elf_link_hash_entry *h)
   struct ppc_elf_link_hash_entry *eh = ppc_elf_hash_entry (h);
   do
     {
-      if (readonly_dynrelocs (&eh->elf))
+      if (_bfd_elf_readonly_dynrelocs (&eh->elf))
        return TRUE;
       eh = ppc_elf_hash_entry (eh->elf.u.alias);
     } while (eh != NULL && &eh->elf != h);
@@ -4826,7 +4809,7 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
                   && !UNDEFWEAK_NO_DYNAMIC_RELOC (info, h)))
              && !htab->is_vxworks
              && !ppc_elf_hash_entry (h)->has_sda_refs
-             && !readonly_dynrelocs (h))
+             && !_bfd_elf_readonly_dynrelocs (h))
            {
              h->pointer_equality_needed = 0;
              /* If we haven't seen a branch reloc and the symbol
@@ -5451,7 +5434,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
   if (h->root.type == bfd_link_hash_indirect)
     return TRUE;
 
-  sec = readonly_dynrelocs (h);
+  sec = _bfd_elf_readonly_dynrelocs (h);
   if (sec != NULL)
     {
       struct bfd_link_info *info = (struct bfd_link_info *) info_p;
index c42ce5e83f559dc1dc7c42627849adcff8c5e98c..c0db4f9bc8efb7966dee0fa256af829fb0c79663 100644 (file)
@@ -1417,23 +1417,6 @@ elf_s390_adjust_gotplt (struct elf_s390_link_hash_entry *h)
   h->gotplt_refcount = -1;
 }
 
-/* Find dynamic relocs for H that apply to read-only sections.  */
-
-static asection *
-readonly_dynrelocs (struct elf_link_hash_entry *h)
-{
-  struct elf_dyn_relocs *p;
-
-  for (p = h->dyn_relocs; p != NULL; p = p->next)
-    {
-      asection *s = p->sec->output_section;
-
-      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-       return p->sec;
-    }
-  return NULL;
-}
-
 /* Adjust a symbol defined by a dynamic object and referenced by a
    regular object.  The current definition is in some section of the
    dynamic object, but we're not including those sections.  We have to
@@ -1558,7 +1541,7 @@ elf_s390_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   /* If we don't find any dynamic relocs in read-only sections, then
      we'll be keeping the dynamic relocs and avoiding the copy reloc.  */
-  if (ELIMINATE_COPY_RELOCS && !readonly_dynrelocs (h))
+  if (ELIMINATE_COPY_RELOCS && !_bfd_elf_readonly_dynrelocs (h))
     {
       h->non_got_ref = 0;
       return TRUE;
@@ -1836,7 +1819,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
   if (h->root.type == bfd_link_hash_indirect)
     return TRUE;
 
-  sec = readonly_dynrelocs (h);
+  sec = _bfd_elf_readonly_dynrelocs (h);
   if (sec != NULL)
     {
       struct bfd_link_info *info = (struct bfd_link_info *) info_p;
index ebce61c017ce68864dc1474c2fcc29cf06991638..29cdb3b5696d8d2a810363cb90a154d55b728709 100644 (file)
@@ -2476,23 +2476,6 @@ sh_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
   return TRUE;
 }
 \f
-/* Find dynamic relocs for H that apply to read-only sections.  */
-
-static asection *
-readonly_dynrelocs (struct elf_link_hash_entry *h)
-{
-  struct elf_dyn_relocs *p;
-
-  for (p = h->dyn_relocs; p != NULL; p = p->next)
-    {
-      asection *s = p->sec->output_section;
-
-      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-       return p->sec;
-    }
-  return NULL;
-}
-
 /* Adjust a symbol defined by a dynamic object and referenced by a
    regular object.  The current definition is in some section of the
    dynamic object, but we're not including those sections.  We have to
@@ -2581,7 +2564,7 @@ sh_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   /* If we don't find any dynamic relocs in read-only sections, then
      we'll be keeping the dynamic relocs and avoiding the copy reloc.  */
-  if (0 && !readonly_dynrelocs (h))
+  if (0 && !_bfd_elf_readonly_dynrelocs (h))
     {
       h->non_got_ref = 0;
       return TRUE;
@@ -2954,7 +2937,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
   if (h->root.type == bfd_link_hash_indirect)
     return TRUE;
 
-  sec = readonly_dynrelocs (h);
+  sec = _bfd_elf_readonly_dynrelocs (h);
   if (sec != NULL)
     {
       struct bfd_link_info *info = (struct bfd_link_info *) info_p;
index 5e0a7d04b7092854014147743b3f663290916d82..f673fe191a68b162fa511f28935a90993101431b 100644 (file)
@@ -1963,23 +1963,6 @@ elf32_tic6x_fake_sections (bfd *abfd ATTRIBUTE_UNUSED,
   return TRUE;
 }
 
-/* Find dynamic relocs for H that apply to read-only sections.  */
-
-static asection *
-readonly_dynrelocs (struct elf_link_hash_entry *h)
-{
-  struct elf_dyn_relocs *p;
-
-  for (p = h->dyn_relocs; p != NULL; p = p->next)
-    {
-      asection *s = p->sec->output_section;
-
-      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-       return p->sec;
-    }
-  return NULL;
-}
-
 /* Adjust a symbol defined by a dynamic object and referenced by a
    regular object.  The current definition is in some section of the
    dynamic object, but we're not including those sections.  We have to
@@ -3198,7 +3181,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
   if (h->root.type == bfd_link_hash_indirect)
     return TRUE;
 
-  sec = readonly_dynrelocs (h);
+  sec = _bfd_elf_readonly_dynrelocs (h);
   if (sec != NULL)
     {
       struct bfd_link_info *info = (struct bfd_link_info *) info_p;
index 4b7446fa40c94d962d39e92e61a0b9b2c5138e75..cb6cda811776f3b201d4985aa3296cade73f8bfe 100644 (file)
@@ -1871,23 +1871,6 @@ tilepro_elf_gc_mark_hook (asection *sec,
   return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
 }
 
-/* Find dynamic relocs for H that apply to read-only sections.  */
-
-static asection *
-readonly_dynrelocs (struct elf_link_hash_entry *h)
-{
-  struct elf_dyn_relocs *p;
-
-  for (p = h->dyn_relocs; p != NULL; p = p->next)
-    {
-      asection *s = p->sec->output_section;
-
-      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-       return p->sec;
-    }
-  return NULL;
-}
-
 /* Adjust a symbol defined by a dynamic object and referenced by a
    regular object.  The current definition is in some section of the
    dynamic object, but we're not including those sections.  We have to
@@ -1973,7 +1956,7 @@ tilepro_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   /* If we don't find any dynamic relocs in read-only sections, then
      we'll be keeping the dynamic relocs and avoiding the copy reloc.  */
-  if (!readonly_dynrelocs (h))
+  if (!_bfd_elf_readonly_dynrelocs (h))
     {
       h->non_got_ref = 0;
       return TRUE;
@@ -2227,7 +2210,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
   if (h->root.type == bfd_link_hash_indirect)
     return TRUE;
 
-  sec = readonly_dynrelocs (h);
+  sec = _bfd_elf_readonly_dynrelocs (h);
   if (sec != NULL)
     {
       struct bfd_link_info *info = (struct bfd_link_info *) info_p;
index 5903217077d5ca3afaad6a8a1bab7d6585c59e9a..49fda96be7a3f8222478995169bd1c8addc68419 100644 (file)
@@ -6356,23 +6356,6 @@ ppc64_elf_func_desc_adjust (bfd *obfd ATTRIBUTE_UNUSED,
   return TRUE;
 }
 
-/* Find dynamic relocs for H that apply to read-only sections.  */
-
-static asection *
-readonly_dynrelocs (struct elf_link_hash_entry *h)
-{
-  struct elf_dyn_relocs *p;
-
-  for (p = h->dyn_relocs; p != NULL; p = p->next)
-    {
-      asection *s = p->sec->output_section;
-
-      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-       return p->sec;
-    }
-  return NULL;
-}
-
 /* Return true if we have dynamic relocs against H or any of its weak
    aliases, that apply to read-only sections.  Cannot be used after
    size_dynamic_sections.  */
@@ -6383,7 +6366,7 @@ alias_readonly_dynrelocs (struct elf_link_hash_entry *h)
   struct ppc_link_hash_entry *eh = ppc_elf_hash_entry (h);
   do
     {
-      if (readonly_dynrelocs (&eh->elf))
+      if (_bfd_elf_readonly_dynrelocs (&eh->elf))
        return TRUE;
       eh = ppc_elf_hash_entry (eh->elf.u.alias);
     }
@@ -6492,7 +6475,7 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
             extra work in ld.so when resolving these symbols.  */
          if (global_entry_stub (h))
            {
-             if (!readonly_dynrelocs (h))
+             if (!_bfd_elf_readonly_dynrelocs (h))
                {
                  h->pointer_equality_needed = 0;
                  /* If we haven't seen a branch reloc and the symbol
@@ -6510,7 +6493,7 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
          return TRUE;
        }
       else if (!h->needs_plt
-              && !readonly_dynrelocs (h))
+              && !_bfd_elf_readonly_dynrelocs (h))
        {
          /* If we haven't seen a branch reloc and the symbol isn't an
             ifunc then we don't need a plt entry.  */
@@ -9890,7 +9873,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *inf)
   if (h->root.type == bfd_link_hash_indirect)
     return TRUE;
 
-  sec = readonly_dynrelocs (h);
+  sec = _bfd_elf_readonly_dynrelocs (h);
   if (sec != NULL)
     {
       struct bfd_link_info *info = (struct bfd_link_info *) inf;
index ec070ce4a332db2abd7b31da5955857c8742d222..07ec4709bbfb8becef63bf102bd705ea951b0719 100644 (file)
@@ -1352,23 +1352,6 @@ elf_s390_adjust_gotplt (struct elf_s390_link_hash_entry *h)
   h->gotplt_refcount = -1;
 }
 
-/* Find dynamic relocs for H that apply to read-only sections.  */
-
-static asection *
-readonly_dynrelocs (struct elf_link_hash_entry *h)
-{
-  struct elf_dyn_relocs *p;
-
-  for (p = h->dyn_relocs; p != NULL; p = p->next)
-    {
-      asection *s = p->sec->output_section;
-
-      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-       return p->sec;
-    }
-  return NULL;
-}
-
 /* Adjust a symbol defined by a dynamic object and referenced by a
    regular object.  The current definition is in some section of the
    dynamic object, but we're not including those sections.  We have to
@@ -1492,7 +1475,7 @@ elf_s390_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   /* If we don't find any dynamic relocs in read-only sections, then
      we'll be keeping the dynamic relocs and avoiding the copy reloc.  */
-  if (ELIMINATE_COPY_RELOCS && !readonly_dynrelocs (h))
+  if (ELIMINATE_COPY_RELOCS && !_bfd_elf_readonly_dynrelocs (h))
     {
       h->non_got_ref = 0;
       return TRUE;
@@ -1772,7 +1755,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
   if (h->root.type == bfd_link_hash_indirect)
     return TRUE;
 
-  sec = readonly_dynrelocs (h);
+  sec = _bfd_elf_readonly_dynrelocs (h);
   if (sec != NULL)
     {
       struct bfd_link_info *info = (struct bfd_link_info *) info_p;
index f87927f0bd8f7b71d41ff23c517d49d8895728ad..0d659c20257a663e38511d8126157509cbcd4413 100644 (file)
@@ -14793,3 +14793,20 @@ bfd_elf_define_start_stop (struct bfd_link_info *info,
     }
   return NULL;
 }
+
+/* Find dynamic relocs for H that apply to read-only sections.  */
+
+asection *
+_bfd_elf_readonly_dynrelocs (struct elf_link_hash_entry *h)
+{
+  struct elf_dyn_relocs *p;
+
+  for (p = h->dyn_relocs; p != NULL; p = p->next)
+    {
+      asection *s = p->sec->output_section;
+
+      if (s != NULL && (s->flags & SEC_READONLY) != 0)
+       return p->sec;
+    }
+  return NULL;
+}
index cbf10deaa4b937039546da08c3b9f2cd00f8d339..f521786c8c3183fde85260fba1ccafba28e68a27 100644 (file)
@@ -7381,23 +7381,6 @@ elfNN_aarch64_print_private_bfd_data (bfd *abfd, void *ptr)
   return TRUE;
 }
 
-/* Find dynamic relocs for H that apply to read-only sections.  */
-
-static asection *
-readonly_dynrelocs (struct elf_link_hash_entry *h)
-{
-  struct elf_dyn_relocs *p;
-
-  for (p = h->dyn_relocs; p != NULL; p = p->next)
-    {
-      asection *s = p->sec->output_section;
-
-      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-       return p->sec;
-    }
-  return NULL;
-}
-
 /* Return true if we need copy relocation against EH.  */
 
 static bfd_boolean
@@ -8915,7 +8898,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
   if (h->root.type == bfd_link_hash_indirect)
     return TRUE;
 
-  sec = readonly_dynrelocs (h);
+  sec = _bfd_elf_readonly_dynrelocs (h);
   if (sec != NULL)
     {
       struct bfd_link_info *info = (struct bfd_link_info *) info_p;
index f6c92b80282b58313dbc2c70c6dac72a8ca3a128..1b530d83dffd76e42aee66ac6d4ef5bd584dcbce 100644 (file)
@@ -782,23 +782,6 @@ riscv_elf_gc_mark_hook (asection *sec,
   return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
 }
 
-/* Find dynamic relocs for H that apply to read-only sections.  */
-
-static asection *
-readonly_dynrelocs (struct elf_link_hash_entry *h)
-{
-  struct elf_dyn_relocs *p;
-
-  for (p = h->dyn_relocs; p != NULL; p = p->next)
-    {
-      asection *s = p->sec->output_section;
-
-      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-       return p->sec;
-    }
-  return NULL;
-}
-
 /* Adjust a symbol defined by a dynamic object and referenced by a
    regular object.  The current definition is in some section of the
    dynamic object, but we're not including those sections.  We have to
@@ -887,7 +870,7 @@ riscv_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   /* If we don't find any dynamic relocs in read-only sections, then
      we'll be keeping the dynamic relocs and avoiding the copy reloc.  */
-  if (!readonly_dynrelocs (h))
+  if (!_bfd_elf_readonly_dynrelocs (h))
     {
       h->non_got_ref = 0;
       return TRUE;
@@ -1147,7 +1130,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
   if (h->root.type == bfd_link_hash_indirect)
     return TRUE;
 
-  sec = readonly_dynrelocs (h);
+  sec = _bfd_elf_readonly_dynrelocs (h);
   if (sec != NULL)
     {
       struct bfd_link_info *info = (struct bfd_link_info *) info_p;
index d6e3b6d437ef03948671cc02ea73a34c3f676ccb..633ac59bcc1d13ceb5c3e8c5822432a2be6a6b82 100644 (file)
@@ -1919,23 +1919,6 @@ _bfd_sparc_elf_fixup_symbol (struct bfd_link_info *info,
   return TRUE;
 }
 
-/* Find dynamic relocs for H that apply to read-only sections.  */
-
-static asection *
-readonly_dynrelocs (struct elf_link_hash_entry *h)
-{
-  struct elf_dyn_relocs *p;
-
-  for (p = h->dyn_relocs; p != NULL; p = p->next)
-    {
-      asection *s = p->sec->output_section;
-
-      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-       return p->sec;
-    }
-  return NULL;
-}
-
 /* Adjust a symbol defined by a dynamic object and referenced by a
    regular object.  The current definition is in some section of the
    dynamic object, but we're not including those sections.  We have to
@@ -2032,7 +2015,7 @@ _bfd_sparc_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   /* If we don't find any dynamic relocs in read-only sections, then
      we'll be keeping the dynamic relocs and avoiding the copy reloc.  */
-  if (!readonly_dynrelocs (h))
+  if (!_bfd_elf_readonly_dynrelocs (h))
     {
       h->non_got_ref = 0;
       return TRUE;
@@ -2418,7 +2401,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
   if (h->root.type == bfd_link_hash_indirect)
     return TRUE;
 
-  sec = readonly_dynrelocs (h);
+  sec = _bfd_elf_readonly_dynrelocs (h);
   if (sec != NULL)
     {
       struct bfd_link_info *info = (struct bfd_link_info *) info_p;
index 3e73e0b18eb499d0c4d26780717f0cbdadeb8636..75b4621276705e049f97c3c5b7484bd8e6282bbc 100644 (file)
@@ -2114,23 +2114,6 @@ tilegx_elf_gc_mark_hook (asection *sec,
   return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
 }
 
-/* Find dynamic relocs for H that apply to read-only sections.  */
-
-static asection *
-readonly_dynrelocs (struct elf_link_hash_entry *h)
-{
-  struct elf_dyn_relocs *p;
-
-  for (p = h->dyn_relocs; p != NULL; p = p->next)
-    {
-      asection *s = p->sec->output_section;
-
-      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-       return p->sec;
-    }
-  return NULL;
-}
-
 /* Adjust a symbol defined by a dynamic object and referenced by a
    regular object.  The current definition is in some section of the
    dynamic object, but we're not including those sections.  We have to
@@ -2219,7 +2202,7 @@ tilegx_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
 
   /* If we don't find any dynamic relocs in read-only sections, then
      we'll be keeping the dynamic relocs and avoiding the copy reloc.  */
-  if (!readonly_dynrelocs (h))
+  if (!_bfd_elf_readonly_dynrelocs (h))
     {
       h->non_got_ref = 0;
       return TRUE;
@@ -2473,7 +2456,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p)
   if (h->root.type == bfd_link_hash_indirect)
     return TRUE;
 
-  sec = readonly_dynrelocs (h);
+  sec = _bfd_elf_readonly_dynrelocs (h);
   if (sec != NULL)
     {
       struct bfd_link_info *info = (struct bfd_link_info *) info_p;
index e385ddb539127bb0ec7c4238788a8c992fe9ad37..c89559914e77ae18196704097a45b60cbae6abca 100644 (file)
@@ -532,23 +532,6 @@ elf_x86_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
   return TRUE;
 }
 
-/* Find dynamic relocs for H that apply to read-only sections.  */
-
-static asection *
-readonly_dynrelocs (struct elf_link_hash_entry *h)
-{
-  struct elf_dyn_relocs *p;
-
-  for (p = h->dyn_relocs; p != NULL; p = p->next)
-    {
-      asection *s = p->sec->output_section;
-
-      if (s != NULL && (s->flags & SEC_READONLY) != 0)
-       return p->sec;
-    }
-  return NULL;
-}
-
 /* Set DF_TEXTREL if we find any dynamic relocs that apply to
    read-only sections.  */
 
@@ -564,7 +547,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *inf)
   if (h->forced_local && h->type == STT_GNU_IFUNC)
     return TRUE;
 
-  sec = readonly_dynrelocs (h);
+  sec = _bfd_elf_readonly_dynrelocs (h);
   if (sec != NULL)
     {
       struct bfd_link_info *info = (struct bfd_link_info *) inf;
@@ -2078,7 +2061,7 @@ _bfd_x86_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
       /* If we don't find any dynamic relocs in read-only sections,
         then we'll be keeping the dynamic relocs and avoiding the copy
         reloc.  */
-      if (!readonly_dynrelocs (h))
+      if (!_bfd_elf_readonly_dynrelocs (h))
        {
          h->non_got_ref = 0;
          return TRUE;
This page took 0.056468 seconds and 4 git commands to generate.