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

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