The powerpc64 support opted to pass floating point values both in the

fpr area and the parameter save area, necessary when the backend
doesn't know if a function argument corresponds to the ellipsis
arguments of a variadic function.  This patch adds powerpc support for
variadic functions, and changes the code to only pass fp in the ABI
mandated area.  ELFv2 needs this change since the parameter save area
may not exist there.

This also fixes two faulty tests that used a non-variadic function
cast to call a variadic function, and spuriously reasoned that this is
somehow necessary for static functions..
This commit is contained in:
Alan Modra
2013-11-16 06:38:55 -05:00
committed by Anthony Green
parent 31257b3189
commit 164283f4ac
5 changed files with 95 additions and 58 deletions

View File

@@ -1,3 +1,20 @@
2013-11-16 Alan Modra <amodra@gmail.com>
* src/powerpc/ffitarget.h (FFI_TARGET_SPECIFIC_VARIADIC): Define.
(FFI_EXTRA_CIF_FIELDS): Define.
* src/powerpc/ffi.c (ffi_prep_args64): Save fprs as per the
ABI, not to both fpr and param save area.
(ffi_prep_cif_machdep_core): Renamed from ffi_prep_cif_machdep.
Keep initial flags. Formatting. Remove dead FFI_LINUX_SOFT_FLOAT
code.
(ffi_prep_cif_machdep, ffi_prep_cif_machdep_var): New functions.
(ffi_closure_helper_LINUX64): Pass floating point as per ABI,
not to both fpr and parameter save areas.
* libffi/testsuite/libffi.call/cls_double_va.c (main): Correct
function cast and don't call ffi_prep_cif.
* libffi/testsuite/libffi.call/cls_longdouble_va.c (main): Likewise.
2013-11-15 Andrew Haley <aph@redhat.com>
* doc/libffi.texi (Closure Example): Fix the sample code.