aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-s390.c
diff options
context:
space:
mode:
authorAndreas Krebbel <krebbel@linux.vnet.ibm.com>2017-12-08 17:23:56 +0100
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>2017-12-13 13:35:01 +0100
commit10e7c0457cb7531f8b205e29e88b3e191cfa6037 (patch)
tree9bcd9e9f6389372448de33b0e54b035a5a6a53c8 /bfd/elf64-s390.c
parent9937536c23ae005422cec23d38a6b7f6fa8e1f48 (diff)
downloadgdb-10e7c0457cb7531f8b205e29e88b3e191cfa6037.zip
gdb-10e7c0457cb7531f8b205e29e88b3e191cfa6037.tar.gz
gdb-10e7c0457cb7531f8b205e29e88b3e191cfa6037.tar.bz2
S/390: Fix (some) PIE+undef weak failures
This fixes these failures on 64 bit which currently occur when running the Binutils testsuite with a default PIE compiler. < FAIL: Build rdynamic-1 < FAIL: Build dynamic-1 < FAIL: Build pr22269-1 bfd/ChangeLog: 2017-12-13 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * elf64-s390.c (elf_s390_adjust_dynamic_symbol): Use UNDEFWEAK_NO_DYNAMIC_RELOC. (allocate_dynrelocs): Likewise. (elf_s390_relocate_section): Check resolved_to_zero. (elf_s390_finish_dynamic_symbol): Don't generate runtime reloc if UNDEFWEAK_NO_DYNAMIC_RELOC.
Diffstat (limited to 'bfd/elf64-s390.c')
-rw-r--r--bfd/elf64-s390.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
index a7a8445..0936e78 100644
--- a/bfd/elf64-s390.c
+++ b/bfd/elf64-s390.c
@@ -1433,8 +1433,7 @@ elf_s390_adjust_dynamic_symbol (struct bfd_link_info *info,
{
if (h->plt.refcount <= 0
|| SYMBOL_CALLS_LOCAL (info, h)
- || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
- && h->root.type == bfd_link_hash_undefweak))
+ || UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
{
/* This case can occur if we saw a PLT32 reloc in an input
file, but the symbol was never referred to by a dynamic
@@ -1669,8 +1668,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h,
htab->elf.srelgot->size += sizeof (Elf64_External_Rela);
else if (tls_type == GOT_TLS_GD)
htab->elf.srelgot->size += 2 * sizeof (Elf64_External_Rela);
- else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- || h->root.type != bfd_link_hash_undefweak)
+ else if (!UNDEFWEAK_NO_DYNAMIC_RELOC (info, h)
&& (bfd_link_pic (info)
|| WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)))
htab->elf.srelgot->size += sizeof (Elf64_External_Rela);
@@ -2313,8 +2311,7 @@ elf_s390_relocate_section (bfd *output_bfd,
h)
|| (bfd_link_pic (info)
&& SYMBOL_REFERENCES_LOCAL (info, h))
- || (ELF_ST_VISIBILITY (h->other)
- && h->root.type == bfd_link_hash_undefweak))
+ || resolved_to_zero)
{
/* This is actually a static link, or it is a
-Bsymbolic link and the symbol is defined
@@ -3417,6 +3414,9 @@ elf_s390_finish_dynamic_symbol (bfd *output_bfd,
else if (bfd_link_pic (info)
&& SYMBOL_REFERENCES_LOCAL (info, h))
{
+ if (UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
+ return TRUE;
+
/* If this is a static link, or it is a -Bsymbolic link and
the symbol is defined locally or was forced to be local
because of a version file, we just want to emit a