patches/binutils/2.22/999-ppc-textrels.patch
author Cody P Schafer <dev@codyps.com>
Mon May 12 00:02:13 2014 +0200 (2014-05-12)
changeset 3322 eb13867a034c
permissions -rw-r--r--
arch/powerpc: add powerpc64le support

Technically, I don't forbid powerpcle support either, but I'm not sure that
there is any library/compiler support for that at the moment (though the hw
technically makes it possible).

powerpc64le needs glibc 2.19 and gcc 4.9. I haven't looked into the support
tools, but at least gdb 7.5 is too old (7.7.1 definitely has support).

Also make powerpc64 non-experimental. It's practically old at this point.

Signed-off-by: Cody P Schafer <dev@codyps.com>
[yann.morin.1998@free.fr: use ${target_endian_le} and ${target_bits_64}]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Message-Id: <64bfbbced9dd8f62e0d6.1399801945@gun>
Patchwork-Id: 347775
benoit@2810
     1
http://bugs.gentoo.org/392645
benoit@2810
     2
http://sourceware.org/bugzilla/show_bug.cgi?id=13470
benoit@2810
     3
benoit@2810
     4
2011-12-03  Alan Modra  <amodra@gmail.com>
benoit@2810
     5
benoit@2810
     6
	PR ld/13470
benoit@2810
     7
	* elf32-ppc.c (ppc_elf_copy_indirect_symbol): Revert substantive
benoit@2810
     8
	change in 2011-07-01 commit.  Comment.
benoit@2810
     9
	* elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
benoit@2810
    10
benoit@2810
    11
diff -durN binutils-2.22.orig/bfd/elf32-ppc.c binutils-2.22/bfd/elf32-ppc.c
benoit@2810
    12
--- binutils-2.22.orig/bfd/elf32-ppc.c	2011-11-21 10:29:21.000000000 +0100
benoit@2810
    13
+++ binutils-2.22/bfd/elf32-ppc.c	2011-12-14 19:52:43.308784395 +0100
benoit@2810
    14
@@ -2987,10 +2987,6 @@
benoit@2810
    15
   edir->elf.needs_plt |= eind->elf.needs_plt;
benoit@2810
    16
   edir->elf.pointer_equality_needed |= eind->elf.pointer_equality_needed;
benoit@2810
    17
 
benoit@2810
    18
-  /* If we were called to copy over info for a weak sym, that's all.  */
benoit@2810
    19
-  if (eind->elf.root.type != bfd_link_hash_indirect)
benoit@2810
    20
-    return;
benoit@2810
    21
-
benoit@2810
    22
   if (eind->dyn_relocs != NULL)
benoit@2810
    23
     {
benoit@2810
    24
       if (edir->dyn_relocs != NULL)
benoit@2810
    25
@@ -3022,6 +3018,16 @@
benoit@2810
    26
       eind->dyn_relocs = NULL;
benoit@2810
    27
     }
benoit@2810
    28
 
benoit@2810
    29
+  /* If we were called to copy over info for a weak sym, that's all.
benoit@2810
    30
+     You might think dyn_relocs need not be copied over;  After all,
benoit@2810
    31
+     both syms will be dynamic or both non-dynamic so we're just
benoit@2810
    32
+     moving reloc accounting around.  However, ELIMINATE_COPY_RELOCS 
benoit@2810
    33
+     code in ppc_elf_adjust_dynamic_symbol needs to check for
benoit@2810
    34
+     dyn_relocs in read-only sections, and it does so on what is the
benoit@2810
    35
+     DIR sym here.  */
benoit@2810
    36
+  if (eind->elf.root.type != bfd_link_hash_indirect)
benoit@2810
    37
+    return;
benoit@2810
    38
+
benoit@2810
    39
   /* Copy over the GOT refcount entries that we may have already seen to
benoit@2810
    40
      the symbol which just became indirect.  */
benoit@2810
    41
   edir->elf.got.refcount += eind->elf.got.refcount;
benoit@2810
    42
diff -durN binutils-2.22.orig/bfd/elf64-ppc.c binutils-2.22/bfd/elf64-ppc.c
benoit@2810
    43
--- binutils-2.22.orig/bfd/elf64-ppc.c	2011-11-21 10:29:24.000000000 +0100
benoit@2810
    44
+++ binutils-2.22/bfd/elf64-ppc.c	2011-12-14 19:52:43.336784395 +0100
benoit@2810
    45
@@ -4435,10 +4435,6 @@
benoit@2810
    46
   edir->elf.ref_regular_nonweak |= eind->elf.ref_regular_nonweak;
benoit@2810
    47
   edir->elf.needs_plt |= eind->elf.needs_plt;
benoit@2810
    48
 
benoit@2810
    49
-  /* If we were called to copy over info for a weak sym, that's all.  */
benoit@2810
    50
-  if (eind->elf.root.type != bfd_link_hash_indirect)
benoit@2810
    51
-    return;
benoit@2810
    52
-
benoit@2810
    53
   /* Copy over any dynamic relocs we may have on the indirect sym.  */
benoit@2810
    54
   if (eind->dyn_relocs != NULL)
benoit@2810
    55
     {
benoit@2810
    56
@@ -4471,6 +4467,16 @@
benoit@2810
    57
       eind->dyn_relocs = NULL;
benoit@2810
    58
     }
benoit@2810
    59
 
benoit@2810
    60
+  /* If we were called to copy over info for a weak sym, that's all.
benoit@2810
    61
+     You might think dyn_relocs need not be copied over;  After all,
benoit@2810
    62
+     both syms will be dynamic or both non-dynamic so we're just
benoit@2810
    63
+     moving reloc accounting around.  However, ELIMINATE_COPY_RELOCS 
benoit@2810
    64
+     code in ppc64_elf_adjust_dynamic_symbol needs to check for
benoit@2810
    65
+     dyn_relocs in read-only sections, and it does so on what is the
benoit@2810
    66
+     DIR sym here.  */
benoit@2810
    67
+  if (eind->elf.root.type != bfd_link_hash_indirect)
benoit@2810
    68
+    return;
benoit@2810
    69
+
benoit@2810
    70
   /* Copy over got entries that we may have already seen to the
benoit@2810
    71
      symbol which just became indirect.  */
benoit@2810
    72
   if (eind->elf.got.glist != NULL)