summaryrefslogtreecommitdiff
path: root/gdb/ppc-sysv-tdep.c
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2014-02-04 18:26:26 +0100
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2014-02-04 18:26:26 +0100
commitd63167affc2a56189e3ba2cc47dd9a3451208b59 (patch)
tree984aa7abbc8be7fb64569a8773f397a0db3743ec /gdb/ppc-sysv-tdep.c
parente765b44c3853ed228506fc22c276becd63198238 (diff)
downloadbinutils-gdb-d63167affc2a56189e3ba2cc47dd9a3451208b59.tar.gz
PowerPC64 little-endian fixes: structure passing
When passing a small structure in a GPR, the ABI specifies that it should be passed in the least-significant bytes of the register (or stack slot). On big-endian systems, this means the value needs to be stored at an offset, which is what current code does. However, on little-endian systems, the least-significant bytes are addresses with offset 0. This patch fixes that. gdb/ChangeLog: * ppc-sysv-tdep.c (ppc64_sysv_abi_push_val): Use correct offset on little-endian when passing small structures.
Diffstat (limited to 'gdb/ppc-sysv-tdep.c')
-rw-r--r--gdb/ppc-sysv-tdep.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c
index 77a71bc987a..62e9cbdaccb 100644
--- a/gdb/ppc-sysv-tdep.c
+++ b/gdb/ppc-sysv-tdep.c
@@ -1150,7 +1150,8 @@ ppc64_sysv_abi_push_val (struct gdbarch *gdbarch,
doubleword are right-aligned and those larger are left-aligned.
GCC versions before 3.4 implemented this incorrectly; see
<http://gcc.gnu.org/gcc-3.4/powerpc-abi.html>. */
- if (len < tdep->wordsize)
+ if (len < tdep->wordsize
+ && gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
offset = tdep->wordsize - len;
if (argpos->regcache)