diff options
Diffstat (limited to 'bfd/elf64-s390.c')
-rw-r--r-- | bfd/elf64-s390.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c index f93c613..83eb836 100644 --- a/bfd/elf64-s390.c +++ b/bfd/elf64-s390.c @@ -1,5 +1,5 @@ /* IBM S/390-specific support for 64-bit ELF - Copyright 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed Martin Schwidefsky (schwidefsky@de.ibm.com). @@ -1881,9 +1881,21 @@ allocate_dynrelocs (h, inf) /* Also discard relocs on undefined weak syms with non-default visibility. */ - if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + if (eh->dyn_relocs != NULL && h->root.type == bfd_link_hash_undefweak) - eh->dyn_relocs = NULL; + { + if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT) + eh->dyn_relocs = NULL; + + /* Make sure undefined weak symbols are output as a dynamic + symbol in PIEs. */ + else if (h->dynindx == -1 + && !h->forced_local) + { + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + } + } } else if (ELIMINATE_COPY_RELOCS) { |