999-ppc-textrels.patch 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. http://bugs.gentoo.org/392645
  2. http://sourceware.org/bugzilla/show_bug.cgi?id=13470
  3. 2011-12-03 Alan Modra <amodra@gmail.com>
  4. PR ld/13470
  5. * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Revert substantive
  6. change in 2011-07-01 commit. Comment.
  7. * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
  8. ===================================================================
  9. RCS file: /cvs/src/src/bfd/elf32-ppc.c,v
  10. retrieving revision 1.302.2.1
  11. retrieving revision 1.302.2.2
  12. diff -u -r1.302.2.1 -r1.302.2.2
  13. --- src/bfd/elf32-ppc.c 2011/11/15 11:36:52 1.302.2.1
  14. +++ src/bfd/elf32-ppc.c 2011/12/03 00:58:01 1.302.2.2
  15. @@ -2987,10 +2987,6 @@
  16. edir->elf.needs_plt |= eind->elf.needs_plt;
  17. edir->elf.pointer_equality_needed |= eind->elf.pointer_equality_needed;
  18. - /* If we were called to copy over info for a weak sym, that's all. */
  19. - if (eind->elf.root.type != bfd_link_hash_indirect)
  20. - return;
  21. -
  22. if (eind->dyn_relocs != NULL)
  23. {
  24. if (edir->dyn_relocs != NULL)
  25. @@ -3022,6 +3018,16 @@
  26. eind->dyn_relocs = NULL;
  27. }
  28. + /* If we were called to copy over info for a weak sym, that's all.
  29. + You might think dyn_relocs need not be copied over; After all,
  30. + both syms will be dynamic or both non-dynamic so we're just
  31. + moving reloc accounting around. However, ELIMINATE_COPY_RELOCS
  32. + code in ppc_elf_adjust_dynamic_symbol needs to check for
  33. + dyn_relocs in read-only sections, and it does so on what is the
  34. + DIR sym here. */
  35. + if (eind->elf.root.type != bfd_link_hash_indirect)
  36. + return;
  37. +
  38. /* Copy over the GOT refcount entries that we may have already seen to
  39. the symbol which just became indirect. */
  40. edir->elf.got.refcount += eind->elf.got.refcount;
  41. ===================================================================
  42. RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
  43. retrieving revision 1.363.2.4
  44. retrieving revision 1.363.2.5
  45. diff -u -r1.363.2.4 -r1.363.2.5
  46. --- src/bfd/elf64-ppc.c 2011/11/08 13:46:36 1.363.2.4
  47. +++ src/bfd/elf64-ppc.c 2011/12/03 00:58:02 1.363.2.5
  48. @@ -4435,10 +4435,6 @@
  49. edir->elf.ref_regular_nonweak |= eind->elf.ref_regular_nonweak;
  50. edir->elf.needs_plt |= eind->elf.needs_plt;
  51. - /* If we were called to copy over info for a weak sym, that's all. */
  52. - if (eind->elf.root.type != bfd_link_hash_indirect)
  53. - return;
  54. -
  55. /* Copy over any dynamic relocs we may have on the indirect sym. */
  56. if (eind->dyn_relocs != NULL)
  57. {
  58. @@ -4471,6 +4467,16 @@
  59. eind->dyn_relocs = NULL;
  60. }
  61. + /* If we were called to copy over info for a weak sym, that's all.
  62. + You might think dyn_relocs need not be copied over; After all,
  63. + both syms will be dynamic or both non-dynamic so we're just
  64. + moving reloc accounting around. However, ELIMINATE_COPY_RELOCS
  65. + code in ppc64_elf_adjust_dynamic_symbol needs to check for
  66. + dyn_relocs in read-only sections, and it does so on what is the
  67. + DIR sym here. */
  68. + if (eind->elf.root.type != bfd_link_hash_indirect)
  69. + return;
  70. +
  71. /* Copy over got entries that we may have already seen to the
  72. symbol which just became indirect. */
  73. if (eind->elf.got.glist != NULL)