|
|
7ab123 |
commit d63167affc2a56189e3ba2cc47dd9a3451208b59
|
|
|
7ab123 |
Author: Ulrich Weigand <ulrich.weigand@de.ibm.com>
|
|
|
7ab123 |
Date: Tue Feb 4 18:26:26 2014 +0100
|
|
|
7ab123 |
|
|
|
7ab123 |
PowerPC64 little-endian fixes: structure passing
|
|
|
7ab123 |
|
|
|
7ab123 |
When passing a small structure in a GPR, the ABI specifies that it
|
|
|
7ab123 |
should be passed in the least-significant bytes of the register
|
|
|
7ab123 |
(or stack slot). On big-endian systems, this means the value
|
|
|
7ab123 |
needs to be stored at an offset, which is what current code does.
|
|
|
7ab123 |
|
|
|
7ab123 |
However, on little-endian systems, the least-significant bytes are
|
|
|
7ab123 |
addresses with offset 0. This patch fixes that.
|
|
|
7ab123 |
|
|
|
7ab123 |
gdb/ChangeLog:
|
|
|
7ab123 |
|
|
|
7ab123 |
* ppc-sysv-tdep.c (ppc64_sysv_abi_push_val): Use correct
|
|
|
7ab123 |
offset on little-endian when passing small structures.
|
|
|
7ab123 |
|
|
|
7ab123 |
Index: gdb-7.6.1/gdb/ppc-sysv-tdep.c
|
|
|
7ab123 |
===================================================================
|
|
|
7ab123 |
--- gdb-7.6.1.orig/gdb/ppc-sysv-tdep.c
|
|
|
7ab123 |
+++ gdb-7.6.1/gdb/ppc-sysv-tdep.c
|
|
|
7ab123 |
@@ -1149,7 +1149,8 @@ ppc64_sysv_abi_push_val (struct gdbarch
|
|
|
7ab123 |
doubleword are right-aligned and those larger are left-aligned.
|
|
|
7ab123 |
GCC versions before 3.4 implemented this incorrectly; see
|
|
|
7ab123 |
<http://gcc.gnu.org/gcc-3.4/powerpc-abi.html>. */
|
|
|
7ab123 |
- if (len < tdep->wordsize)
|
|
|
7ab123 |
+ if (len < tdep->wordsize
|
|
|
7ab123 |
+ && gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
|
|
|
7ab123 |
offset = tdep->wordsize - len;
|
|
|
7ab123 |
|
|
|
7ab123 |
if (argpos->regcache)
|