diff options
author | Alan Modra <amodra@gmail.com> | 2011-12-03 00:55:50 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2011-12-03 00:55:50 +0000 |
commit | 68ba6d402de919a43e3def82bc24d85d7c2ed04e (patch) | |
tree | 5cb3f0777e1ac3f69d374d64fe1b081b39d04ca7 /bfd | |
parent | 03cf8d5f0832996634c26ba73433776513c5150b (diff) | |
download | gdb-68ba6d402de919a43e3def82bc24d85d7c2ed04e.zip gdb-68ba6d402de919a43e3def82bc24d85d7c2ed04e.tar.gz gdb-68ba6d402de919a43e3def82bc24d85d7c2ed04e.tar.bz2 |
PR ld/13470
* elf32-ppc.c (ppc_elf_copy_indirect_symbol): Revert substantive
change in 2011-07-01 commit. Comment.
* elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 7 | ||||
-rw-r--r-- | bfd/elf32-ppc.c | 14 | ||||
-rw-r--r-- | bfd/elf64-ppc.c | 14 |
3 files changed, 27 insertions, 8 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 22270f5..12c332a 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2011-12-03 Alan Modra <amodra@gmail.com> + + PR ld/13470 + * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Revert substantive + change in 2011-07-01 commit. Comment. + * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise. + 2011-12-01 Mikael Pettersson <mikpe@it.uu.se> * elf32-m68k.c (elf_m68k_check_relocs) <R_68K_8, R68K_16, R_68K_32>: For diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 5263ae5..18922dc 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -2987,10 +2987,6 @@ ppc_elf_copy_indirect_symbol (struct bfd_link_info *info, 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, that's all. */ - if (eind->elf.root.type != bfd_link_hash_indirect) - return; - if (eind->dyn_relocs != NULL) { if (edir->dyn_relocs != NULL) @@ -3022,6 +3018,16 @@ ppc_elf_copy_indirect_symbol (struct bfd_link_info *info, eind->dyn_relocs = NULL; } + /* If we were called to copy over info for a weak sym, that's all. + You might think dyn_relocs need not be copied over; After all, + both syms will be dynamic or both non-dynamic so we're just + moving reloc accounting around. However, ELIMINATE_COPY_RELOCS + code in ppc_elf_adjust_dynamic_symbol needs to check for + dyn_relocs in read-only sections, and it does so on what is the + DIR sym here. */ + if (eind->elf.root.type != bfd_link_hash_indirect) + return; + /* Copy over the GOT refcount entries that we may have already seen to the symbol which just became indirect. */ edir->elf.got.refcount += eind->elf.got.refcount; diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 6f0e83e..4560599 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -4435,10 +4435,6 @@ ppc64_elf_copy_indirect_symbol (struct bfd_link_info *info, edir->elf.ref_regular_nonweak |= eind->elf.ref_regular_nonweak; edir->elf.needs_plt |= eind->elf.needs_plt; - /* 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 any dynamic relocs we may have on the indirect sym. */ if (eind->dyn_relocs != NULL) { @@ -4471,6 +4467,16 @@ ppc64_elf_copy_indirect_symbol (struct bfd_link_info *info, eind->dyn_relocs = NULL; } + /* If we were called to copy over info for a weak sym, that's all. + You might think dyn_relocs need not be copied over; After all, + both syms will be dynamic or both non-dynamic so we're just + moving reloc accounting around. However, ELIMINATE_COPY_RELOCS + code in ppc64_elf_adjust_dynamic_symbol needs to check for + dyn_relocs in read-only sections, and it does so on what is the + DIR sym here. */ + if (eind->elf.root.type != bfd_link_hash_indirect) + return; + /* Copy over got entries that we may have already seen to the symbol which just became indirect. */ if (eind->elf.got.glist != NULL) |