aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-ppc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2006-02-17 04:49:34 +0000
committerAlan Modra <amodra@gmail.com>2006-02-17 04:49:34 +0000
commitdfbb6ac93371afb54c68283d7072f8e001fa01ce (patch)
treed9ffebf94a4d00f2dc429620c2bbf08654adc13f /bfd/elf32-ppc.c
parent86a7cd1632c97576280062ccf3d55582f179f83c (diff)
downloadgdb-dfbb6ac93371afb54c68283d7072f8e001fa01ce.zip
gdb-dfbb6ac93371afb54c68283d7072f8e001fa01ce.tar.gz
gdb-dfbb6ac93371afb54c68283d7072f8e001fa01ce.tar.bz2
PR ld/2218
* elf64-ppc.c (allocate_dynrelocs): Ensure undef weak sym is dynamic. (ppc64_elf_relocate_section): Check output reloc section size. * elf32-ppc.c (allocate_dynrelocs): Simplify undef weak test.
Diffstat (limited to 'bfd/elf32-ppc.c')
-rw-r--r--bfd/elf32-ppc.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index e6de049..caa5ed4 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -4546,20 +4546,19 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
/* Also discard relocs on undefined weak syms with non-default
visibility. */
- if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
- && h->root.type == bfd_link_hash_undefweak)
- eh->dyn_relocs = NULL;
-
- /* Make sure undefined weak symbols are output as a dynamic symbol
- in PIEs. */
- if (info->pie
- && eh->dyn_relocs != NULL
- && h->dynindx == -1
- && h->root.type == bfd_link_hash_undefweak
- && !h->forced_local)
+ if (h->root.type == bfd_link_hash_undefweak)
{
- if (! bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
+ 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)