[Ltrace-devel] [PATCH] On ppc64, argument are pointed by register r3. On ppc64Le, Aggregates or unions of any length, and character strings of length longer than 8 bytes, are returned in a storage buffer passed as a hidden first arg in r3, causing the first explicit argument to be passed in r4.

thierry at linux.vnet.ibm.com thierry at linux.vnet.ibm.com
Tue Apr 5 07:25:43 UTC 2016


From: Thierry Fauck <tfauck at free.fr>

Signed-off-by: Thierry Fauck <tfauck at free.fr>

	modified:   sysdeps/linux-gnu/ppc/fetch.c
---
 sysdeps/linux-gnu/ppc/fetch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sysdeps/linux-gnu/ppc/fetch.c b/sysdeps/linux-gnu/ppc/fetch.c
index 860cb86..133f953 100644
--- a/sysdeps/linux-gnu/ppc/fetch.c
+++ b/sysdeps/linux-gnu/ppc/fetch.c
@@ -610,7 +610,7 @@ arch_fetch_retval(struct fetch_context *ctx, enum tof type,
 		assert(info->type == ARGTYPE_STRUCT);
 
 		uint64_t addr;
-		if ( ctx->regs.r32[1] == 0 )
+		if ( ppc64_call_elf_abi != 2 || ctx->regs.r32[1] == 0 )
                         addr = read_gpr(ctx, proc, 3);
                 else
                         addr = read_gpr(ctx, proc, 4);
-- 
1.8.3.1




More information about the Ltrace-devel mailing list