|
From: Julian S. <js...@ac...> - 2006-08-01 11:48:47
|
On Tuesday 01 August 2006 07:03, Greg Parker wrote:
> vex's doHelperCall for ppc32 has an OS dependence
> where Linux and Darwin do not match:
>
> if (argreg%2 == 1) // Linux ppc32 abi spec for passing LONG_LONG
> argreg++; // XXX: odd argreg => even rN
>
> When passing a 64-bit integer parameter, Linux may skip a register,
> which is handled by the code above. Darwin doesn't do that. This
> first manifests itself in calls to Memcheck's MC_(helperc_STOREV64be),
> causing random values to be written into the v bits.
Yes. I fell across the exact same issue on AIX. In fact Vex
contains a bunch of other guest ABI and host ABI specific hacks
too, and so I fixed it up properly by creating the following
structure and passing it to both the Vex front and back ends.
.host_ppc32_regalign_int64_args is the relevant field here.
This will appear in the public repo in due course.
J
/* This struct carries guest and host ABI variant information that may
be needed. Fields which are meaningless or ignored for the
platform in question should be set to zero. */
typedef
struct {
/* PPC and AMD64 GUESTS only: how many bytes below the
stack pointer are validly addressible? */
Int guest_stack_redzone_size;
/* PPC GUESTS only: should we zap the stack red zone at a 'blr'
(function return) ? */
Bool guest_ppc_zap_RZ_at_blr;
/* PPC GUESTS only: should we zap the stack red zone at a 'bl'
(function call) ? Is supplied with the guest address of the
target of the call since that may be significant. If NULL,
is assumed equivalent to a fn which always returns False. */
Bool (*guest_ppc_zap_RZ_at_bl)(Addr64);
/* PPC32/PPC64 GUESTS only: where does the kernel resume after
'sc'? False => Linux style, at the next insn. True => AIX
style, at the address stated in the link register. */
Bool guest_ppc_sc_continues_at_LR;
/* PPC32/PPC64 HOSTS only: does '&f' give us a pointer to a
function descriptor on the host, or to the function code
itself? True => descriptor, False => code. */
Bool host_ppc_calls_use_fndescrs;
/* PPC32 HOSTS only: when generating code to pass a 64-bit value
(actual parameter) in a pair of regs, should we skip an arg
reg if it is even-numbered? True => yes, False => no. */
Bool host_ppc32_regalign_int64_args;
}
VexABIInfo;
|