summaryrefslogtreecommitdiffstats
path: root/contrib/binutils
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2006-06-08 13:10:51 +0000
committermarius <marius@FreeBSD.org>2006-06-08 13:10:51 +0000
commitf5e830d091704c984593d6fe745fe30c4036c944 (patch)
treefd2776d6ed879d3abcd56c3b3671244d180fed22 /contrib/binutils
parent1b66131eb118df4cbc164d0a5ee82dbe00a58611 (diff)
downloadFreeBSD-src-f5e830d091704c984593d6fe745fe30c4036c944.zip
FreeBSD-src-f5e830d091704c984593d6fe745fe30c4036c944.tar.gz
* elf64-sparc.c (sparc64_elf_adjust_dynamic_symbol): When linking a
non-shared object, do not reserve space in .plt and .rela.plt for regular symbols neither defined nor referenced in shared objects. This is a backport of rev. 1.101 (sourceware.org repository) to Binutils 2.15 which fixes the creation of bogus relocations in the PLT of Firefox and Thunderbird binaries and which in turn caused them to segfault in rtld(1). This is committed to the vendor branch as it doesn't represent a local change but the original vendor fix is from after elf_link_hash_flags was replaced with bitfields. PR: sparc64/89486 Approved by: maintainer timeout Obtained from: NetBSD MFC after: 1 week
Diffstat (limited to 'contrib/binutils')
-rw-r--r--contrib/binutils/bfd/elf64-sparc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/contrib/binutils/bfd/elf64-sparc.c b/contrib/binutils/bfd/elf64-sparc.c
index 4568a22..90de3b9 100644
--- a/contrib/binutils/bfd/elf64-sparc.c
+++ b/contrib/binutils/bfd/elf64-sparc.c
@@ -1638,7 +1638,11 @@ sparc64_elf_adjust_dynamic_symbol (info, h)
|| h->root.type == bfd_link_hash_defweak)
&& (h->root.u.def.section->flags & SEC_CODE) != 0))
{
- if (! elf_hash_table (info)->dynamic_sections_created)
+ if (! info->shared
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0
+ && h->root.type != bfd_link_hash_undefweak
+ && h->root.type != bfd_link_hash_undefined)
{
/* This case can occur if we saw a WPLT30 reloc in an input
file, but none of the input files were dynamic objects.
OpenPOWER on IntegriCloud