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

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