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