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

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