From 474436e67c72d2426e79e600d725812514db0dbe Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sat, 3 Dec 2016 20:55:25 +1030 Subject: [PATCH] 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. --- bfd/ChangeLog | 5 +++++ bfd/elf64-ppc.c | 29 ++++++++++++++++------------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 70b4105440..84ac6c0e3a 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2016-12-03 Alan Modra + + * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't copy dynamic + flags when direct symbol is versioned_hidden. + 2016-12-02 Nick Clifton PR lf/20908 diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 5a4bc724cf..bfdfc09cc8 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 -- 2.34.1