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

2c2fa1
commit 5b757e5ddbd9ad252d9c51103f1aa52b41c2e947
2c2fa1
Author: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2c2fa1
Date:   Tue Feb 4 18:33:04 2014 +0100
2c2fa1
2c2fa1
    PowerPC64 little-endian fixes: 32-bit DFP parameters
2c2fa1
    
2c2fa1
    Passing a 32-bit DFP in register needs to use the least-significant part
2c2fa1
    of the register.  Like with a previous patch that addressed the same
2c2fa1
    issue for small structs, this patch makes sure the appropriate offset
2c2fa1
    is used on little-endian systems.
2c2fa1
    
2c2fa1
    gdb/ChangeLog:
2c2fa1
    
2c2fa1
    	* ppc-sysv-tdep.c (ppc64_sysv_abi_push_freg): Use correct
2c2fa1
    	offset on little-endian when passing _Decimal32.
2c2fa1
    	(ppc64_sysv_abi_return_value_base): Likewise for return values.
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
@@ -1231,7 +1231,10 @@ ppc64_sysv_abi_push_freg (struct gdbarch
2c2fa1
       if (argpos->regcache && argpos->freg <= 13)
2c2fa1
 	{
2c2fa1
 	  int regnum = tdep->ppc_fp0_regnum + argpos->freg;
2c2fa1
-	  int offset = 8 - TYPE_LENGTH (type);
2c2fa1
+	  int offset = 0;
2c2fa1
+
2c2fa1
+	  if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
2c2fa1
+	    offset = 8 - TYPE_LENGTH (type);
2c2fa1
 
2c2fa1
 	  regcache_cooked_write_part (argpos->regcache, regnum,
2c2fa1
 				      offset, TYPE_LENGTH (type), val);
2c2fa1
@@ -1640,7 +1643,10 @@ ppc64_sysv_abi_return_value_base (struct
2c2fa1
       && TYPE_CODE (valtype) == TYPE_CODE_DECFLOAT)
2c2fa1
     {
2c2fa1
       int regnum = tdep->ppc_fp0_regnum + 1 + index;
2c2fa1
-      int offset = 8 - TYPE_LENGTH (valtype);
2c2fa1
+      int offset = 0;
2c2fa1
+
2c2fa1
+      if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
2c2fa1
+	offset = 8 - TYPE_LENGTH (valtype);
2c2fa1
 
2c2fa1
       if (writebuf != NULL)
2c2fa1
 	regcache_cooked_write_part (regcache, regnum,