Root/toolchain/binutils/patches/2.22/999-ppc-textrels.patch

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

Archive Download this file



interactive