Blame SOURCES/gdb-rhbz1125820-ppc64le-enablement-24of37.patch

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