Blame SOURCES/gdb-rhbz1125820-ppc64le-enablement-20of37.patch

01917d
commit 3ba720c788c2845c93a6dfe592f36163cbfa63fd
01917d
Author: Alan Modra <amodra@gmail.com>
01917d
Date:   Fri Jan 24 14:22:10 2014 +1030
01917d
01917d
    Fixes powerpc64le ld segfaults when --emit-relocs is used.
01917d
    
01917d
    ELFv2 needs fewer relocs to annotate plt call stubs.  I correctly
01917d
    allocated a smaller buffer and wrote the proper relocs, but stupidly
01917d
    bumped the reloc count as for ELFv1.
01917d
    
01917d
    	* elf64-ppc.c (ppc_build_one_stub): Correct reloc count passed
01917d
    	to get_relocs for ELFv2.
01917d
01917d
Index: gdb-7.6.1/bfd/elf64-ppc.c
01917d
===================================================================
01917d
--- gdb-7.6.1.orig/bfd/elf64-ppc.c
01917d
+++ gdb-7.6.1/bfd/elf64-ppc.c
01917d
@@ -10546,10 +10546,11 @@ ppc_build_one_stub (struct bfd_hash_entr
01917d
       if (info->emitrelocations)
01917d
 	{
01917d
 	  r = get_relocs (stub_entry->stub_sec,
01917d
-			  (2
01917d
-			   + (PPC_HA (off) != 0)
01917d
-			   + (htab->plt_static_chain
01917d
-			      && PPC_HA (off + 16) == PPC_HA (off))));
01917d
+			  ((PPC_HA (off) != 0)
01917d
+			   + (htab->opd_abi
01917d
+			      ? 2 + (htab->plt_static_chain
01917d
+				     && PPC_HA (off + 16) == PPC_HA (off))
01917d
+			      : 1)));
01917d
 	  if (r == NULL)
01917d
 	    return FALSE;
01917d
 	  r[0].r_offset = loc - stub_entry->stub_sec->contents;