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

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