From: Ulrich Weigand Date: Tue, 4 Feb 2014 17:26:26 +0000 (+0100) Subject: PowerPC64 little-endian fixes: structure passing X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d63167affc2a56189e3ba2cc47dd9a3451208b59;p=binutils-gdb.git 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 281c441ff43..ffa636ea63d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2014-02-04 Ulrich Weigand  + + * ppc-sysv-tdep.c (ppc64_sysv_abi_push_val): Use correct + offset on little-endian when passing small structures. + 2014-02-04 Ulrich Weigand  * ppc-sysv-tdep.c (get_decimal_float_return_value): Update comment. 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 . */ - if (len < tdep->wordsize) + if (len < tdep->wordsize + && gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) offset = tdep->wordsize - len; if (argpos->regcache)