This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] ppc64_elf_copy_indirect_symbol versioned_hidden fix
- From: Alan Modra <amodra at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 3 Dec 2016 10:55:10 -0000
- Subject: [binutils-gdb] ppc64_elf_copy_indirect_symbol versioned_hidden fix
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=474436e67c72d2426e79e600d725812514db0dbe
commit 474436e67c72d2426e79e600d725812514db0dbe
Author: Alan Modra <amodra@gmail.com>
Date: Sat Dec 3 20:55:25 2016 +1030
ppc64_elf_copy_indirect_symbol versioned_hidden fix
As per _bfd_elf_link_hash_copy_indirect.
* elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't copy dynamic
flags when direct symbol is versioned_hidden.
Diff:
---
bfd/ChangeLog | 5 +++++
bfd/elf64-ppc.c | 29 ++++++++++++++++-------------
2 files changed, 21 insertions(+), 13 deletions(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 70b4105..84ac6c0 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2016-12-03 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't copy dynamic
+ flags when direct symbol is versioned_hidden.
+
2016-12-02 Nick Clifton <nickc@redhat.com>
PR lf/20908
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 5a4bc72..bfdfc09 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -4740,19 +4740,22 @@ ppc64_elf_copy_indirect_symbol (struct bfd_link_info *info,
if (eind->oh != NULL)
edir->oh = ppc_follow_link (eind->oh);
- /* If called to transfer flags for a weakdef during processing
- of elf_adjust_dynamic_symbol, don't copy NON_GOT_REF.
- We clear it ourselves for ELIMINATE_COPY_RELOCS. */
- if (!(ELIMINATE_COPY_RELOCS
- && eind->elf.root.type != bfd_link_hash_indirect
- && edir->elf.dynamic_adjusted))
- edir->elf.non_got_ref |= eind->elf.non_got_ref;
-
- edir->elf.ref_dynamic |= eind->elf.ref_dynamic;
- edir->elf.ref_regular |= eind->elf.ref_regular;
- edir->elf.ref_regular_nonweak |= eind->elf.ref_regular_nonweak;
- edir->elf.needs_plt |= eind->elf.needs_plt;
- edir->elf.pointer_equality_needed |= eind->elf.pointer_equality_needed;
+ if (edir->elf.versioned != versioned_hidden)
+ {
+ /* If called to transfer flags for a weakdef during processing
+ of elf_adjust_dynamic_symbol, don't copy NON_GOT_REF.
+ We clear it ourselves for ELIMINATE_COPY_RELOCS. */
+ if (!(ELIMINATE_COPY_RELOCS
+ && eind->elf.root.type != bfd_link_hash_indirect
+ && edir->elf.dynamic_adjusted))
+ edir->elf.non_got_ref |= eind->elf.non_got_ref;
+
+ edir->elf.ref_dynamic |= eind->elf.ref_dynamic;
+ edir->elf.ref_regular |= eind->elf.ref_regular;
+ edir->elf.ref_regular_nonweak |= eind->elf.ref_regular_nonweak;
+ edir->elf.needs_plt |= eind->elf.needs_plt;
+ edir->elf.pointer_equality_needed |= eind->elf.pointer_equality_needed;
+ }
/* If we were called to copy over info for a weak sym, don't copy
dyn_relocs, plt/got info, or dynindx. We used to copy dyn_relocs