PowerPC64 ELFv2 ABI: stack frame layout changes
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Tue, 4 Feb 2014 17:41:36 +0000 (18:41 +0100)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Tue, 4 Feb 2014 17:41:36 +0000 (18:41 +0100)
This implementes another change in ELFv2: the stack frame no longer
contains the reserved double words for linker and compiler use
(which weren't really used for much of anything anyway).  This
affects placement of on-stack parameters in inferior calls.

gdb/ChangeLog:

* ppc-sysv-tdep.c (ppc64_sysv_abi_push_dummy_call): Use correct
offset to the stack parameter list for the ELFv2 ABI.

gdb/ChangeLog
gdb/ppc-sysv-tdep.c

index 795e23f129214d9c073a225dbe2a39280520cb18..a47934687157bd2a5bcc678e63b539a18c31c31e 100644 (file)
@@ -1,3 +1,8 @@
+2014-02-04  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * ppc-sysv-tdep.c (ppc64_sysv_abi_push_dummy_call): Use correct
+       offset to the stack parameter list for the ELFv2 ABI.
+
 2014-02-04  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * ppc-linux-tdep.c (ppc_linux_init_abi): Only call
index b7fb4297d394fc828bcbb181d58ba26429b0b8c0..f6b24bf92a989918fd9ca6cdf563d0d94c5ee313 100644 (file)
@@ -1474,9 +1474,13 @@ ppc64_sysv_abi_push_dummy_call (struct gdbarch *gdbarch,
          argpos.regcache = regcache;
          argpos.refparam = align_down (sp - refparam_size, 16);
          argpos.gparam = align_down (argpos.refparam - gparam_size, 16);
-         /* Add in space for the TOC, link editor double word,
-            compiler double word, LR save area, CR save area.  */
-         sp = align_down (argpos.gparam - 48, 16);
+         /* Add in space for the TOC, link editor double word (v1 only),
+            compiler double word (v1 only), LR save area, CR save area,
+            and backchain.  */
+         if (tdep->elf_abi == POWERPC_ELF_V1)
+           sp = align_down (argpos.gparam - 48, 16);
+         else
+           sp = align_down (argpos.gparam - 32, 16);
        }
 
       /* If the function is returning a `struct', then there is an
This page took 0.046078 seconds and 4 git commands to generate.