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

2c2fa1
commit 52f548e41f085550d7740c350c1c8a239532af77
2c2fa1
Author: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2c2fa1
Date:   Tue Feb 4 18:41:36 2014 +0100
2c2fa1
2c2fa1
    PowerPC64 ELFv2 ABI: stack frame layout changes
2c2fa1
    
2c2fa1
    This implementes another change in ELFv2: the stack frame no longer
2c2fa1
    contains the reserved double words for linker and compiler use
2c2fa1
    (which weren't really used for much of anything anyway).  This
2c2fa1
    affects placement of on-stack parameters in inferior calls.
2c2fa1
    
2c2fa1
    gdb/ChangeLog:
2c2fa1
    
2c2fa1
    	* ppc-sysv-tdep.c (ppc64_sysv_abi_push_dummy_call): Use correct
2c2fa1
    	offset to the stack parameter list for the ELFv2 ABI.
2c2fa1
2c2fa1
Index: gdb-7.6.1/gdb/ppc-sysv-tdep.c
2c2fa1
===================================================================
2c2fa1
--- gdb-7.6.1.orig/gdb/ppc-sysv-tdep.c
2c2fa1
+++ gdb-7.6.1/gdb/ppc-sysv-tdep.c
2c2fa1
@@ -1473,9 +1473,13 @@ ppc64_sysv_abi_push_dummy_call (struct g
2c2fa1
 	  argpos.regcache = regcache;
2c2fa1
 	  argpos.refparam = align_down (sp - refparam_size, 16);
2c2fa1
 	  argpos.gparam = align_down (argpos.refparam - gparam_size, 16);
2c2fa1
-	  /* Add in space for the TOC, link editor double word,
2c2fa1
-	     compiler double word, LR save area, CR save area.  */
2c2fa1
-	  sp = align_down (argpos.gparam - 48, 16);
2c2fa1
+	  /* Add in space for the TOC, link editor double word (v1 only),
2c2fa1
+	     compiler double word (v1 only), LR save area, CR save area,
2c2fa1
+	     and backchain.  */
2c2fa1
+	  if (tdep->elf_abi == POWERPC_ELF_V1)
2c2fa1
+	    sp = align_down (argpos.gparam - 48, 16);
2c2fa1
+	  else
2c2fa1
+	    sp = align_down (argpos.gparam - 32, 16);
2c2fa1
 	}
2c2fa1
 
2c2fa1
       /* If the function is returning a `struct', then there is an