benoit@2810: http://bugs.gentoo.org/392645 benoit@2810: http://sourceware.org/bugzilla/show_bug.cgi?id=13470 benoit@2810: benoit@2810: 2011-12-03 Alan Modra benoit@2810: benoit@2810: PR ld/13470 benoit@2810: * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Revert substantive benoit@2810: change in 2011-07-01 commit. Comment. benoit@2810: * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise. benoit@2810: benoit@2810: diff -durN binutils-2.22.orig/bfd/elf32-ppc.c binutils-2.22/bfd/elf32-ppc.c benoit@2810: --- binutils-2.22.orig/bfd/elf32-ppc.c 2011-11-21 10:29:21.000000000 +0100 benoit@2810: +++ binutils-2.22/bfd/elf32-ppc.c 2011-12-14 19:52:43.308784395 +0100 benoit@2810: @@ -2987,10 +2987,6 @@ benoit@2810: edir->elf.needs_plt |= eind->elf.needs_plt; benoit@2810: edir->elf.pointer_equality_needed |= eind->elf.pointer_equality_needed; benoit@2810: benoit@2810: - /* If we were called to copy over info for a weak sym, that's all. */ benoit@2810: - if (eind->elf.root.type != bfd_link_hash_indirect) benoit@2810: - return; benoit@2810: - benoit@2810: if (eind->dyn_relocs != NULL) benoit@2810: { benoit@2810: if (edir->dyn_relocs != NULL) benoit@2810: @@ -3022,6 +3018,16 @@ benoit@2810: eind->dyn_relocs = NULL; benoit@2810: } benoit@2810: benoit@2810: + /* If we were called to copy over info for a weak sym, that's all. benoit@2810: + You might think dyn_relocs need not be copied over; After all, benoit@2810: + both syms will be dynamic or both non-dynamic so we're just benoit@2810: + moving reloc accounting around. However, ELIMINATE_COPY_RELOCS benoit@2810: + code in ppc_elf_adjust_dynamic_symbol needs to check for benoit@2810: + dyn_relocs in read-only sections, and it does so on what is the benoit@2810: + DIR sym here. */ benoit@2810: + if (eind->elf.root.type != bfd_link_hash_indirect) benoit@2810: + return; benoit@2810: + benoit@2810: /* Copy over the GOT refcount entries that we may have already seen to benoit@2810: the symbol which just became indirect. */ benoit@2810: edir->elf.got.refcount += eind->elf.got.refcount; benoit@2810: diff -durN binutils-2.22.orig/bfd/elf64-ppc.c binutils-2.22/bfd/elf64-ppc.c benoit@2810: --- binutils-2.22.orig/bfd/elf64-ppc.c 2011-11-21 10:29:24.000000000 +0100 benoit@2810: +++ binutils-2.22/bfd/elf64-ppc.c 2011-12-14 19:52:43.336784395 +0100 benoit@2810: @@ -4435,10 +4435,6 @@ benoit@2810: edir->elf.ref_regular_nonweak |= eind->elf.ref_regular_nonweak; benoit@2810: edir->elf.needs_plt |= eind->elf.needs_plt; benoit@2810: benoit@2810: - /* If we were called to copy over info for a weak sym, that's all. */ benoit@2810: - if (eind->elf.root.type != bfd_link_hash_indirect) benoit@2810: - return; benoit@2810: - benoit@2810: /* Copy over any dynamic relocs we may have on the indirect sym. */ benoit@2810: if (eind->dyn_relocs != NULL) benoit@2810: { benoit@2810: @@ -4471,6 +4467,16 @@ benoit@2810: eind->dyn_relocs = NULL; benoit@2810: } benoit@2810: benoit@2810: + /* If we were called to copy over info for a weak sym, that's all. benoit@2810: + You might think dyn_relocs need not be copied over; After all, benoit@2810: + both syms will be dynamic or both non-dynamic so we're just benoit@2810: + moving reloc accounting around. However, ELIMINATE_COPY_RELOCS benoit@2810: + code in ppc64_elf_adjust_dynamic_symbol needs to check for benoit@2810: + dyn_relocs in read-only sections, and it does so on what is the benoit@2810: + DIR sym here. */ benoit@2810: + if (eind->elf.root.type != bfd_link_hash_indirect) benoit@2810: + return; benoit@2810: + benoit@2810: /* Copy over got entries that we may have already seen to the benoit@2810: symbol which just became indirect. */ benoit@2810: if (eind->elf.got.glist != NULL)