The powerpc64 ABIs align structs passed by value, a fact ignored by

gcc for quite some time.  Since gcc now does the correct alignment,
libffi needs to follow suit.  This ought to be made selectable via
a new abi value, and the #ifdefs removed from ffi.c along with many
other #ifdefs present there and in assembly.  I'll do that with a
followup patch sometime.

This is a revised version of
https://sourceware.org/ml/libffi-discuss/2013/msg00162.html
This commit is contained in:
Alan Modra
2013-11-16 06:41:36 -05:00
committed by Anthony Green
parent a97cf1fae5
commit 1c06515d92
2 changed files with 40 additions and 0 deletions

View File

@@ -1,3 +1,10 @@
2013-11-16 Alan Modra <amodra@gmail.com>
* src/powerpc/ffi.c (ffi_prep_args64): Align struct parameters
according to __STRUCT_PARM_ALIGN__.
(ffi_prep_cif_machdep_core): Likewise.
(ffi_closure_helper_LINUX64): Likewise.
2013-11-16 Alan Modra <amodra@gmail.com>
* src/powerpc/linux64.S (ffi_call_LINUX64): Tweak restore of r28.