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