diff options
author | Alan Modra <amodra@gmail.com> | 2006-02-21 01:51:59 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2006-02-21 01:51:59 +0000 |
commit | 22d606e9c28ce92ff1fd0f006b2878ab685cd0b6 (patch) | |
tree | 645f93511a85f876664a2fc7a42d538d59549e0b /bfd/elf32-s390.c | |
parent | 3168356f3eb718ff80c708385aef801873af855c (diff) | |
download | gdb-22d606e9c28ce92ff1fd0f006b2878ab685cd0b6.zip gdb-22d606e9c28ce92ff1fd0f006b2878ab685cd0b6.tar.gz gdb-22d606e9c28ce92ff1fd0f006b2878ab685cd0b6.tar.bz2 |
PR ld/2218
* elf32-arm.c (allocate_dynrelocs): Ensure undef weak sym in pie
is dynamic.
* elf32-hppa.c (allocate_dynrelocs): Likewise.
* elf32-i386.c (allocate_dynrelocs): Likewise.
* elf32-s390.c (allocate_dynrelocs): Likewise.
* elf32-sh.c (allocate_dynrelocs): Likewise.
* elf64-s390.c (allocate_dynrelocs): Likewise.
* elf64-x86-64.c (allocate_dynrelocs): Likewise.
* elf32-m32r.c (allocate_dynrelocs): Likewise. Discard relocs
on undef weak with non-default visibility too.
* elfxx-sparc.c (allocate_dynrelocs): Ditto.
Diffstat (limited to 'bfd/elf32-s390.c')
-rw-r--r-- | bfd/elf32-s390.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c index 14a3191..afe6c76 100644 --- a/bfd/elf32-s390.c +++ b/bfd/elf32-s390.c @@ -1,5 +1,5 @@ /* IBM S/390-specific support for 32-bit ELF - Copyright 2000, 2001, 2002, 2003, 2004, 2005 + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Carl B. Pedersen and Martin Schwidefsky. @@ -1908,9 +1908,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) { |