src


Log

Author Commit Date CI Message
Richard Henderson e7b0056d 2014-10-30T13:57:39 x86: Force FFI_TYPE_LONGDOUBLE different from FFI_TYPE_DOUBLE There are few abis that set double = long double. Eliminate the conditional compilation and let this code simply be unused there.
Richard Henderson 4b2fad8f 2014-10-30T12:41:31 x86: Remove some conditional compilation Removal of ifdefs made possible to due to ffi_abi unification.
Richard Henderson 2e9dc165 2014-10-27T13:41:39 x86_64: Fixups for x32
Richard Henderson ebd82769 2014-10-23T23:57:06 win64: Remove support from ffi.c
Richard Henderson 99db4d42 2014-10-23T14:12:18 win64: Rewrite It's way too different from the 32-bit ABIs with which it is currently associated. As seen from all of the existing XFAILs.
Richard Henderson 6b62fb4a 2014-10-17T11:11:58 x86-64: Support go closures Dumps all of the hand-coded unwind info for gas generated. Move jump table data into .rodata. Adjust ffi_call_unix64 to load the static chain. Split out sse portions of ffi_closure_unix64 to ffi_closure_unix64_sse rather than test cif->flags at runtime.
Richard Henderson ef762056 2014-10-30T12:13:31 x86: Tidy ffi_abi The x86_64 unix port only handles one ABI; don't define all of the other symbols. The UNIX64 symbol retains the same value. The i386 ports ought to have the same symbols, even if we can't yet unify the values without incrementing the libffi soname.
Richard Henderson 610c90bf 2014-10-28T11:21:50 x86_64: Add support for complex types
Richard Henderson 32c56831 2014-10-28T11:17:35 x86_64: Decouple return types from FFI_TYPE constants We can better support structure returns, and as prep for complex types.
Anthony Green a0bdc525 2014-11-11T09:43:01 Fix typo
Sebastian Macke 0f316ab7 2014-09-27T00:19:15 Add OpenRISC support This patch adds support for the OpenRISC architecture. (http://opencores.org/or1k/Main_Page) This patch has been tested under Linux with QEMU-user emulation support. - 32 Bit - big endian - delayed instructions This is the only available configuration under Linux. The description of the ABI can be found on the official website. Is passes the testsuite except of the unwindtest_ffi_call.cc testcase, which seems to be a problem of gcc and not libffi. Some testcases of the gcc testsuite still fail. Signed-off-by: Sebastian Macke <sebastian@macke.de>
Anthony Green 6695983d 2014-09-20T07:44:37 Add complex type support. Mostly broken right now
Bernd Edlinger bfcbf329 2014-09-20T06:51:45 2014-05-11 Bernd Edlinger <bernd.edlinger@hotmail.de> Fix current cygwin-64 build problems. * src/java_raw_api.c: Remove if !defined(FFI_NO_RAW_API). * src/x86/ffi.c: Add if defined(__CYGWIN__). * src/x86/win64.S (ffi_closure_win64, ffi_call_win64): Added handling for FFI_TYPE_UINT64, FFI_TYPE_POINTER and FFI_TYPE_INT. Added SEH information. Fixed formatting.
Jakub Jelinek 32cb2ce8 2014-09-20T06:39:55 2014-09-10 Jakub Jelinek <jakub@redhat.com> * src/powerpc/linux64.S: Emit .note.GNU-stack even when POWERPC64 is not defined. * src/powerpc/linux64_closure.S: Likewise. Also test _CALL_ELF == 2.
Matthias Klose aaf3101b 2014-09-20T06:37:04 Fix -Werror=declaration-after-statement problem
Dominik Vogt 6e8a4460 2014-09-20T06:21:19 2014-07-22 Dominik Vogt <vogt@linux.vnet.ibm.com> * src/types.c (FFI_TYPEDEF, FFI_NONCONST_TYPEDEF): Merge the macros by adding another argument that controls whether the result is const or not (FFI_LDBL_CONST): Temporary macro to reduce ifdef confusion * src/prep_cif.c (ffi_prep_cif_core): Replace list of systems with new macro FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION * src/pa/ffitarget.h (FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION): Define. * src/s390/ffitarget.h (FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION): Define. * src/x86/ffitarget.h (FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION): Define. 2014-07-22 Dominik Vogt <vogt@linux.vnet.ibm.com> * doc/libffi.texi (Primitive Types): Document ffi_type_complex_float, ffi_type_complex_double and ffi_type_complex_longdouble (Complex Types): New subsection. (Complex Type Example): Ditto. * testsuite/libffi.call/cls_align_complex_double.c: New FFI_TYPE_COMPLEX test. * testsuite/libffi.call/cls_align_complex_float.c: Ditto. * testsuite/libffi.call/cls_align_complex_longdouble.c: Ditto. * testsuite/libffi.call/cls_complex_double.c: Ditto. * testsuite/libffi.call/cls_complex_float.c: Ditto. * testsuite/libffi.call/cls_complex_longdouble.c: Ditto. * testsuite/libffi.call/cls_complex_struct_double.c: Ditto. * testsuite/libffi.call/cls_complex_struct_float.c: Ditto. * testsuite/libffi.call/cls_complex_struct_longdouble.c: Ditto. * testsuite/libffi.call/cls_complex_va_double.c: Ditto. * testsuite/libffi.call/cls_complex_va_float.c: Ditto. * testsuite/libffi.call/cls_complex_va_longdouble.c: Ditto. * testsuite/libffi.call/complex_double.c: Ditto. * testsuite/libffi.call/complex_defs_double.c: Ditto. * testsuite/libffi.call/complex_float.c: Ditto. * testsuite/libffi.call/complex_defs_float.c: Ditto. * testsuite/libffi.call/complex_longdouble.c: Ditto. * testsuite/libffi.call/complex_defs_longdouble.c: Ditto. * testsuite/libffi.call/complex_int.c: Ditto. * testsuite/libffi.call/many_complex_double.c: Ditto. * testsuite/libffi.call/many_complex_float.c: Ditto. * testsuite/libffi.call/many_complex_longdouble.c: Ditto. * testsuite/libffi.call/return_complex1_double.c: Ditto. * testsuite/libffi.call/return_complex1_float.c: Ditto. * testsuite/libffi.call/return_complex1_longdouble.c: Ditto. * testsuite/libffi.call/return_complex2_double.c: Ditto. * testsuite/libffi.call/return_complex2_float.c: Ditto. * testsuite/libffi.call/return_complex2_longdouble.c: Ditto. * testsuite/libffi.call/return_complex_double.c: Ditto. * testsuite/libffi.call/return_complex_float.c: Ditto. * testsuite/libffi.call/return_complex_longdouble.c: Ditto. * src/raw_api.c (ffi_raw_to_ptrarray): Handle FFI_TYPE_COMPLEX (ffi_ptrarray_to_raw): Ditto. * src/prep_cif.c (ffi_prep_cif_core): Abort if FFI_TYPE_COMPLEX is not implemented in libffi for the target. * src/java_raw_api.c (ffi_java_raw_size): FFI_TYPE_COMPLEX not supported yet (abort). (ffi_java_raw_to_ptrarray): Ditto. (ffi_java_rvalue_to_raw): Ditto. (ffi_java_raw_to_rvalue): Ditto. * src/debug.c (ffi_type_test): Add debug tests for complex types. * include/ffi.h.in (FFI_TYPE_COMPLEX): Add new FFI_TYPE_COMPLEX. (FFI_TYPE_LAST): Bump. (ffi_type_complex_float): Add new ffi_type_.... (ffi_type_complex_double): Ditto. (ffi_type_complex_longdouble): Ditto. 2014-07-22 Dominik Vogt <vogt@linux.vnet.ibm.com> * src/s390/ffitarget.h (FFI_TARGET_HAS_COMPLEX_TYPE): Define to provide FFI_TYPE_COMPLEX support. * src/s390/ffi.c (ffi_check_struct_type): Implement FFI_TYPE_COMPLEX (ffi_prep_args): Ditto. (ffi_prep_cif_machdep): Ditto. (ffi_closure_helper_SYSV): Ditto.
Anthony Green 4c5c4088 2014-09-18T19:10:54 Merge pull request #132 from nielsAD/master Pascal and Register calling convention support on x86
Anthony Green 862f53de 2014-09-18T19:06:08 Merge pull request #130 from frida/fix/darwin-aarch64-float-alignment Fix alignment of FFI_TYPE_FLOAT for Apple's ARM64 ABI
nielsAD 5d6340ef 2014-08-25T17:29:44 Determine whether register arguments (THISCALL/FASTCALL/REGISTER) are really passed via register to closures. Use stack if not.
nielsAD 6e346487 2014-08-25T12:23:29 Fixed THISCALL/FASTCALL closures and added basic support for PASCAL/REGISTER closures.
nielsAD 098dca6b 2014-08-23T00:18:47 Support for calling functions with PASCAL and REGISTER calling conventions on x86 Windows/Linux. Also changed indentation to be more consistent throughout the (adjusted) files.
Ole André Vadla Ravnås aebf2c30 2014-07-25T21:40:50 Fix alignment of FFI_TYPE_FLOAT for Apple's ARM64 ABI
Ole André Vadla Ravnås 0f4e09d2 2014-07-26T00:11:06 Fix non-variadic CIF initialization for Apple/ARM64 Turns out `aarch64_nfixedargs` wasn't initialized in the non-variadic case, resulting in undefined behavior when allocating arguments.
Anthony Green 1cee07be 2014-06-12T06:30:59 Remove compiler warning
Samuli Suominen 978c9540 2014-05-31T08:53:10 Add missing GNU stack markings in win32.S
Mickaël Salaün c1166d4f 2014-05-12T19:44:08 closures: Check for mkostemp(3)
Mickaël Salaün 8daeed95 2014-05-11T22:54:58 closures: Create temporary file with O_TMPFILE and O_CLOEXEC when available The open_temp_exec_file_dir function can create a temporary file without file system accessible link. If the O_TMPFILE flag is not defined (old Linux kernel or libc) the behavior is unchanged. The open_temp_exec_file_name function now need a new argument "flags" (like O_CLOEXEC) used for temporary file creation. The O_TMPFILE flag allow temporary file creation without race condition. This feature/fix prevent another process to access the (future) executable file from the file system. The O_CLOEXEC flag automatically close the temporary file for any execve. This avoid transmitting (executable) file descriptor to a child process.
Magnus Granberg 52b34570 2014-05-11T09:55:28 Check /proc/self/status for PaX status.
Josh Triplett 99909eb6 2014-04-22T21:17:52 src/x86/win32.S: Define ffi_closure_FASTCALL in the MASM section, too
Josh Triplett d3695227 2014-04-20T12:03:25 Support fastcall closures libffi on 32-bit x86 now supports closures for all supported ABIs. Thus, rewrite the last remaining duplicated-by-ABI test (closure_stdcall and closure_thiscall) to use the generic ABI_NUM/ABI_ATTR mechanism.
Anthony Green 8fa28123 2014-04-12T19:32:08 Merge pull request #116 from frida/fix/darwin-aarch64-variadic Fix handling of variadic calls on Darwin/AArch64
Anthony Green 8a58e6b7 2014-04-12T19:30:18 Merge pull request #115 from frida/fix/darwin-aarch64-alignment Fix alignment of AArch64 assembler functions
Ole André Vadla Ravnås 3e2b84d2 2014-04-12T01:04:04 Fix Windows regression Introduced by b5fed601948237037513a9b7f967c8fc6c9ff1f6.
Ole André Vadla Ravnås 419503f4 2014-04-06T20:54:13 Fix handling of variadic calls on Darwin/AArch64
Ole André Vadla Ravnås a539f7ff 2014-04-06T20:53:02 Fix alignment of AArch64 assembler functions
Josh Triplett b5fed601 2014-04-05T17:33:42 Fix ABI on 32-bit non-Windows x86: go back to trampoline size 10 The trampoline size is part of the ABI, so it cannot change. Move the logic from the stdcall and thiscall trampolines to the functions they call, to reduce them both to 10 bytes. This drops the previously added support for raw THISCALL closures on non-Windows. (Non-raw THISCALL closures still work.)
Anthony Green afee5373 2014-03-25T16:12:35 Merge pull request #106 from joshtriplett/darwin-award [3.1 blocker] Update OS X build system to include win32.S on 32-bit
Anthony Green 7d247856 2014-03-25T16:12:17 Merge pull request #110 from joshtriplett/w64 Fix 64-bit Windows support
Josh Triplett be50b87a 2014-03-24T21:44:13 Always use configure to detect whether global symbols need underscores 64-bit Windows already used this check; make it universal, and use it in place of an ifdef on X86_WIN32, to handle non-Windows platforms that use the underscore, such as Darwin.
Josh Triplett 56be47f8 2014-03-24T21:24:53 Fix a warning on 64-bit Windows When sizeof(size_t) != sizeof(unsigned), adding a size_t to cif->bytes produces a "possible loss of data" warning. However, the size_t in question refers to the size of a single parameter. Use a cast to avoid the warning.
Josh Triplett 48a8eda7 2014-03-24T21:21:12 Avoid referencing undefined ABIs on 64-bit Windows builds 64-bit Windows does not have FFI_STDCALL, FFI_THISCALL, or FFI_FASTCALL.
Josh Triplett f0f4138f 2014-03-22T10:00:53 win32.S: Add handling for position-independent code on Darwin Newer versions of Darwin generate the necessary stub functions automatically and just need a call instruction, but accomodating older versions as well requires adding the stub.
Josh Triplett ef5890eb 2014-03-21T11:01:39 win32.S: Use shifting for multiplication rather than repeated addition The jump table code added a register to itself twice to multiply by 4; shift the register left by 2 instead.
Josh Triplett 4fca4890 2014-03-21T11:00:41 win32.S: Make the jump tables position-independent Now that non-Windows platforms include win32.S, it needs to support building as position-independent code. This fixes build failures on target platforms that do not allow text relocations.
Josh Triplett 2087dcf7 2014-03-21T10:57:06 win32.S: Make calls to ffi_closure_SYSV_inner position-independent Now that non-Windows platforms include win32.S, it needs to support building as position-independent code. This fixes one source of build failures on target platforms that do not allow text relocations.
Josh Triplett e1911f78 2014-03-16T03:25:53 Add support for stdcall, thiscall, and fastcall on non-Windows x86-32 Linux supports the stdcall calling convention, either via functions explicitly declared with the stdcall attribute, or via code compiled with -mrtd which effectively makes stdcall the default. This introduces FFI_STDCALL, FFI_THISCALL, and FFI_FASTCALL on non-Windows x86-32 platforms, as non-default calling conventions.
Josh Triplett 9531d05f 2014-03-16T01:50:02 prep_cif.c: Remove unnecessary ifdef for X86_WIN32 ffi_prep_cif_core had a special case for X86_WIN32, checking for FFI_THISCALL in addition to the FFI_FIRST_ABI-to-FFI_LAST_ABI range before returning FFI_BAD_ABI. However, on X86_WIN32, FFI_THISCALL already falls in that range, making the special case unnecessary. Remove it.
Anthony Green 11d7aa9d 2014-02-28T01:06:48 Merge pull request #46 from makotokato/android-clang Fix build failure when using clang for Android
Anthony Green 67fbef3b 2014-02-28T01:06:48 Merge pull request #46 from makotokato/android-clang Fix build failure when using clang for Android
Anthony Green 20698abc 2014-02-28T00:56:27 Merge pull request #66 from ppizarro/master BlackFin fixes - Fatal error when calling a function defined in a shared library from within the function called by FFI
Anthony Green 860fe664 2014-02-28T00:56:27 Merge pull request #66 from ppizarro/master BlackFin fixes - Fatal error when calling a function defined in a shared library from within the function called by FFI
Anthony Green edf29c51 2014-02-28T00:50:25 Merge pull request #75 from joshtriplett/longdouble Fix build error on x86 without distinct long double
Anthony Green 001aaf4b 2014-02-28T00:20:17 When no VFP arguments are present the IP register is used uninitialized. Initialize it to the value of FP. This fixes a number of testsuite failures when configured for armv7l-unknown-linux-gnueabihf
Anthony Green 49f7729c 2014-02-28T00:17:16 aarch64 fix
Anthony Green 447483d5 2014-02-27T15:42:41 Fix ChangeLog merge
Josh Triplett 3998d260 2014-02-17T11:20:33 Fix build error on x86 without distinct long double src/x86/ffi64.c: In function 'classify_argument': src/x86/ffi64.c:205:5: error: duplicate case value case FFI_TYPE_LONGDOUBLE: ^ src/x86/ffi64.c:202:5: error: previously used here case FFI_TYPE_DOUBLE: ^
Anthony Green 51377bda 2014-02-15T08:06:29 Merge pull request #72 from heiher/devel MIPS N32: Fix call floating point va function
Heiher 40927bd3 2014-01-21T23:18:27 Fix call floating point va function I'm not sure floating-point arguments in GPR or FPR before calling variable number arguments function. so, load all arguments to GPR and FPR.
Zachary Waldowski b4df9cf9 2014-02-05T14:22:52 AArch64: Fix void fall-through case when assertions are enabled
Zachary Waldowski f466aad0 2014-01-21T16:38:31 AArch64: Fix missing semicolons when assertions are enabled
Zachary Waldowski 0a0f12ce 2014-01-09T13:50:17 AArch64: Remove duplicitous element_count call. This inhibits an analyzer warning by Clang.
Zachary Waldowski 4330fdcd 2014-01-09T13:53:30 Darwin/aarch64: Respect iOS ABI re: stack argument alignment
Zachary Waldowski 0a333d6c 2014-01-09T14:03:29 Darwin/aarch64: Fix size_t assumptions
Zachary Waldowski 2c18e3c7 2013-12-30T16:14:02 Darwin/aarch64: Fix "shadows declaration" warnings
Zachary Waldowski 1b8a8e20 2014-01-09T13:55:21 Darwin/aarch64: Use Clang cache invalidation builtin
Zachary Waldowski 6030cdca 2013-12-30T15:45:51 Darwin/aarch64: Account for long double being equal to double
Zachary Waldowski 5658b089 2013-12-30T16:33:47 Darwin/aarch64: Use CNAME, restrict .size like ARM
Zachary Waldowski 07175780 2013-12-30T17:48:22 Darwin/aarch64: Fix invalid reference in assembly
Zachary Waldowski 9da28b44 2013-12-30T16:23:21 Darwin/x86_64: Fix 64-bit type shortening warnings
Zachary Waldowski 6eff9ff9 2013-12-30T17:48:10 Darwin/iOS: Improve unified syntax use for LLVM
Zachary Waldowski ba0ea99c 2013-12-30T15:27:44 Fix dlmalloc warnings due to set_segment_flags, sizeof(size_t)
Zachary Waldowski 994be3a5 2013-12-30T15:27:14 Darwin/iOS: Fix mis-typing of vfp_reg_free
Zachary Waldowski a8e0a835 2013-12-30T15:26:20 Darwin/ARM: Assert on NULL dereference This inhibits an analyzer warning by Clang on all platforms.
Zachary Waldowski 13675341 2014-01-09T13:42:08 Darwin/i386: Inhibit Clang previous prototype warnings
Zachary Waldowski 66469c38 2014-01-09T13:41:45 Darwin/ARM: Inhibit Clang previous prototype warnings
Zachary Waldowski 5bfe62a0 2014-01-09T13:41:27 Darwin/AArch64: Inhibit Clang previous prototype warnings
Marcus Comstedt fa5f25c2 2014-01-04T19:00:08 Linux/ppc64: Remove assumption on contents of r11 in closure
Paulo Pizarro 1a0b01e1 2014-01-02T16:17:59 When the function called by the ffi called a function defined in a shared library generate a fatal error The correction was to take into consideration the GOT.
Anthony Green 3dc3f32c 2013-12-05T16:23:25 Undo iOS ARM64 changes.
Zachary Waldowski 0278284e 2013-11-30T03:03:37 Darwin/aarch64: size_t assumptions
Zachary Waldowski 9775446b 2013-11-30T02:39:34 Darwin/aarch64: Fix “shadows declaration” warnings
Zachary Waldowski 4260badc 2013-11-30T02:08:14 Darwin/aarch64: Use Clang cache invalidation builtin
Zachary Waldowski 9fa7998d 2013-11-30T02:07:48 Darwin/aarch64: Inhibit Xcode warning
Zachary Waldowski 0e832048 2013-11-30T02:07:34 Darwin/aarch64: double == long double
Zachary Waldowski b513dfe7 2013-11-30T02:05:22 Darwin/aarch64: Restrict .size to ELF like arm32.
Zachary Waldowski bc978099 2013-11-30T02:04:57 Darwin/aarch64: Potentially(?) fix compile error
Zachary Waldowski d6bb9314 2013-11-30T02:04:22 Darwin/aarch64: Use CNAME refs
Zachary Waldowski 33c46ce5 2013-11-30T04:13:42 Darwin/Mac: Fix 64/32 shortening warnings
Zachary Waldowski 0612081e 2013-11-30T03:03:00 Darwin: Misc size_t warnings
Zachary Waldowski 6a6247d1 2013-11-30T02:55:48 Darwin: Fix dlmalloc warnings due to sizeof(size_t)
Zachary Waldowski 953b6f14 2012-04-24T11:16:20 Darwin/iOS: More unified syntax support w/ Clang. Signed-off-by: Zachary Waldowski <zwaldowski@gmail.com>
Zachary Waldowski c713a553 2012-04-24T10:25:29 Darwin/iOS: Simplify RETLDM arguments for LLVM 3.1 Signed-off-by: Zachary Waldowski <zwaldowski@gmail.com>
Zachary Waldowski 16ba1b80 2012-04-11T23:26:04 Darwin: Silence Clang warnings.
Alan Modra ab79d6e2 2013-11-21T06:12:35 This separates the 32-bit sysv/linux/bsd code from the 64-bit linux code, and makes it possible to link code compiled with different options to those used to compile libffi. For example, a -mlong-double-128 libffi can be used with -mlong-double-64 code. Using the return value area as a place to pass parameters wasn't such a good idea, causing a failure of cls_ulonglong.c. I didn't see this when running the mainline gcc libffi testsuite because that version of the test is inferior to the upstreamm libffi test. Using NUM_FPR_ARG_REGISTERS rather than NUM_FPR_ARG_REGISTERS64 meant that a parameter save area could be allocated before it was strictly necessary. Wrong but harmless. Found when splitting apart ffi.c into 32-bit and 64-bit support.
Alan Modra ac753688 2013-11-21T06:12:35 This separates the 32-bit sysv/linux/bsd code from the 64-bit linux code, and makes it possible to link code compiled with different options to those used to compile libffi. For example, a -mlong-double-128 libffi can be used with -mlong-double-64 code. Using the return value area as a place to pass parameters wasn't such a good idea, causing a failure of cls_ulonglong.c. I didn't see this when running the mainline gcc libffi testsuite because that version of the test is inferior to the upstreamm libffi test. Using NUM_FPR_ARG_REGISTERS rather than NUM_FPR_ARG_REGISTERS64 meant that a parameter save area could be allocated before it was strictly necessary. Wrong but harmless. Found when splitting apart ffi.c into 32-bit and 64-bit support.
Iain Sandoe aa1f62c0 2013-11-18T13:11:56 Fix PowerPC Darwin FDE encodings to use pcrel correctly. Modernise the picbase labels.
Anthony Green 2f450822 2013-11-18T06:52:29 Clean up code to appease modern GCC compiler.
Alan Modra 16d56c51 2013-11-18T06:36:03 An #endif in the wrong place would cause compile failure on powerpcle. Using bl instead of b doesn't cause runtime failures as you might think, but does mess the processor branch prediction.
Alan Modra 83f65b63 2013-11-16T06:53:50 Finally, this adds _CALL_ELF == 2 support. ELFv1 objects can't be linked with ELFv2 objects, so this is one case where preprocessor tests in ffi.c are fine. Also, there is no need to define a new FFI_ELFv2 or somesuch value in enum ffi_abi. FFI_LINUX64 will happily serve both ABIs.
Alan Modra 1fd04578 2013-11-16T06:53:50 Finally, this adds _CALL_ELF == 2 support. ELFv1 objects can't be linked with ELFv2 objects, so this is one case where preprocessor tests in ffi.c are fine. Also, there is no need to define a new FFI_ELFv2 or somesuch value in enum ffi_abi. FFI_LINUX64 will happily serve both ABIs.