Fix ILP32 for aarch64

This commit is contained in:
Anthony Green 2022-06-25 11:06:00 -04:00
parent b5abc4f647
commit fc8c8c1e2c
2 changed files with 10 additions and 0 deletions

View File

@ -200,6 +200,7 @@ See the git log for details at http://github.com/libffi/libffi.
Fix x32 static trampolines.
All struct args are passed by value, regardless of size.
Add support for Loongson's LoonArch64 architecture.
Fix ILP32 aarch64 support.
3.4.2 Jun-28-21
Add static trampoline support for Linux on x86_64 and ARM64.

View File

@ -1027,9 +1027,18 @@ ffi_closure_SYSV_inner (ffi_cif *cif,
{
/* Replace Composite type of size greater than 16 with a
pointer. */
#ifdef __ILP32__
UINT64 avalue_tmp;
memcpy (&avalue_tmp,
allocate_int_to_reg_or_stack (context, &state,
stack, sizeof (void *)),
sizeof (UINT64));
avalue[i] = (void *)(UINT32)avalue_tmp;
#else
avalue[i] = *(void **)
allocate_int_to_reg_or_stack (context, &state, stack,
sizeof (void *));
#endif
}
else
{