+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
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;
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
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;
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. */
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;
}
}
-/* 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. */
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);
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;
}
}
-/* 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
/* 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;
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;
}
\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
/* 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;
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;
_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
/* 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;
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;
_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)
/* 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;
_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
/* 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;
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;
}
}
-/* 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
/* 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;
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;
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. */
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);
&& !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
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;
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
/* 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;
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;
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
/* 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;
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;
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
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;
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
/* 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;
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;
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. */
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);
}
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
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. */
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;
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
/* 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;
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;
}
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;
+}
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
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;
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
/* 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;
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;
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
/* 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;
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;
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
/* 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;
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;
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. */
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;
/* 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;