summaryrefslogtreecommitdiff
path: root/bfd/elf32-s390.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-s390.c')
-rw-r--r--bfd/elf32-s390.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c
index b0f87523d42..74e958279cd 100644
--- a/bfd/elf32-s390.c
+++ b/bfd/elf32-s390.c
@@ -1560,26 +1560,12 @@ elf_s390_adjust_dynamic_symbol (struct bfd_link_info *info,
return TRUE;
}
- if (ELIMINATE_COPY_RELOCS)
+ /* 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))
{
- struct elf_s390_link_hash_entry * eh;
- struct elf_dyn_relocs *p;
-
- eh = (struct elf_s390_link_hash_entry *) h;
- for (p = eh->dyn_relocs; p != NULL; p = p->next)
- {
- s = p->sec->output_section;
- if (s != NULL && (s->flags & SEC_READONLY) != 0)
- break;
- }
-
- /* If we didn't find any dynamic relocs in read-only sections, then
- we'll be keeping the dynamic relocs and avoiding the copy reloc. */
- if (p == NULL)
- {
- h->non_got_ref = 0;
- return TRUE;
- }
+ h->non_got_ref = 0;
+ return TRUE;
}
/* We must allocate the symbol in our .dynbss section, which will