* sh-tdep.c (sh3e_sh4_store_return_value): Correctly store

double values in little endian mode.
This commit is contained in:
Corinna Vinschen
2004-06-03 11:46:34 +00:00
parent 498d4a7155
commit c8a3b559eb
2 changed files with 10 additions and 1 deletions

View File

@@ -1147,7 +1147,11 @@ sh3e_sh4_store_return_value (struct type *type, struct regcache *regcache,
int len = TYPE_LENGTH (type);
int i, regnum = FP0_REGNUM;
for (i = 0; i < len; i += 4)
regcache_raw_write (regcache, regnum++, (char *) valbuf + i);
if (TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
regcache_raw_write (regcache, regnum++,
(char *) valbuf + len - 4 - i);
else
regcache_raw_write (regcache, regnum++, (char *) valbuf + i);
}
else
sh_default_store_return_value (type, regcache, valbuf);