From: Alan Modra Date: Wed, 5 Feb 2003 15:49:04 +0000 (+0000) Subject: * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't copy got and X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6349e62823303e3157524f9e34b6c84eb93f795a;p=binutils-gdb.git * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't copy got and plt info when called to transfer weak sym info. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index b1a2d6714ea..085ae783c08 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2003-02-06 Alan Modra + + * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't copy got and + plt info when called to transfer weak sym info. + 2003-02-05 Alan Modra * reloc.c: Add PPC and PPC64 TLS relocs. diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 26340066482..b86bb858caf 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -3286,7 +3286,24 @@ ppc64_elf_copy_indirect_symbol (bed, dir, ind) eind->dyn_relocs = NULL; } - /* Do the same for got entries. */ + edir->is_func |= eind->is_func; + edir->is_func_descriptor |= eind->is_func_descriptor; + edir->is_entry |= eind->is_entry; + + /* Copy down any references that we may have already seen to the + symbol which just became indirect. */ + edir->elf.elf_link_hash_flags |= + (eind->elf.elf_link_hash_flags + & (ELF_LINK_HASH_REF_DYNAMIC + | ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_REF_REGULAR_NONWEAK + | ELF_LINK_NON_GOT_REF)); + + /* If we were called to copy over info for a weak sym, that's all. */ + if (eind->elf.root.type != bfd_link_hash_indirect) + return; + + /* Copy over got entries. */ if (eind->elf.got.glist != NULL) { if (edir->elf.got.glist != NULL) @@ -3345,22 +3362,6 @@ ppc64_elf_copy_indirect_symbol (bed, dir, ind) eind->elf.plt.plist = NULL; } - edir->is_func |= eind->is_func; - edir->is_func_descriptor |= eind->is_func_descriptor; - edir->is_entry |= eind->is_entry; - - /* Copy down any references that we may have already seen to the - symbol which just became indirect. */ - edir->elf.elf_link_hash_flags |= - (eind->elf.elf_link_hash_flags - & (ELF_LINK_HASH_REF_DYNAMIC - | ELF_LINK_HASH_REF_REGULAR - | ELF_LINK_HASH_REF_REGULAR_NONWEAK - | ELF_LINK_NON_GOT_REF)); - - if (eind->elf.root.type != bfd_link_hash_indirect) - return; - if (edir->elf.dynindx == -1) { edir->elf.dynindx = eind->elf.dynindx;