src/arm/ffi.c


Log

Author Commit Date CI Message
Saleem Abdulrasool 3c372c38 2017-10-24T13:53:56 arm: fix a level of indirection issue Rather than relying on the stack being 0'ed out always, do it manually. The stack generally happened to be zero, and because the compiler realizes that the tests are dealing with chars truncates the read value. However, the top 3 nibbles of the value are undefined and may be non-zero. The indirection level caused a null-pointer dereference. Explicitly scribbling on the stack during the allocation causes test failures without the original zexting behaviour.
Saleem Abdulrasool 7ad0ae7f 2017-10-10T11:44:05 arm: zext return value parameters The closure function (invoked as closure->fun in ffi_closure_XXX_inner) will only populate the actual number of bytes for the true return type, which may be a character. This leaves garbage on the stack when the assembly closure function (i.e. ffi_closure_XXX) reads the return value off of the stack into r0 as a 4-byte value. ffi_closure_XXX always leaves room for at least 4 bytes here, so we can safely set them to 0. Otherwise, if there is garbage in any of these bytes, these end up in r0 and in the returned value as well.
Anthony Green 02a5145a 2017-09-27T21:43:03 Merge pull request #263 from ksjogo/master fix ios builds
Anthony Green 10099d6c 2017-09-27T20:54:09 Merge pull request #271 from frida/fix/qnx-cache-flushing arm: Fix cache flushing on QNX
Gregory Pakosz bd72848c 2017-04-27T13:20:36 Prefix ALIGN macros with FFI_
Johannes Goslar 00406945 2016-07-12T16:08:42 Update Xcodeproj Include all currently relevent files. Call autogen is build script. Fix compiler settings. Fix mach include.
s1341 ed848834 2016-08-10T14:57:22 arm: Fix cache flushing on QNX Use `msync()` directly as `__clear_cache()` is broken in the qnx650_gcc4.8.3 toolchain.
Russell Keith-Magee bc4fc07a 2015-12-21T00:37:06 Fixed #181 -- Corrected problems with ARMv7 build under iOS. Based on a patch from @fealebenpae, with input from @SolaWing and @rth7680, and testing from @superdump.
Richard Henderson ab83cbb9 2014-10-29T14:38:42 arm: Add support for Go closures
Richard Henderson 6fa617da 2014-10-21T11:27:11 arm: Add argument space for the hidden struct return pointer This should have been failing all along, but it's only exposed by the complex_int test case.
Richard Henderson a529bec2 2014-10-21T11:26:59 arm: Add support for complex types
Richard Henderson a4b785ea 2014-10-17T02:07:32 arm: Rewrite ffi_closure Move the push of the argument registers into ffi_closure_SYSV, reducing the size of the trampoline.
Richard Henderson e7f15f60 2014-10-17T01:27:16 arm: Rewrite ffi_call Use the trick to allocate the stack frame for ffi_call_SYSV within ffi_call itself.
Richard Henderson a74a3aad 2014-10-17T01:21:22 arm: Rewrite vfp_type_p Do not modify the ffi_type. Rearrange the tests so that we quickly eliminate structures that cannot match. Return an encoded value of element count and base type.
Richard Henderson 0d39b4bb 2014-10-17T01:02:52 arm: Deref ffi_put_arg arguments
Richard Henderson 57b24fb3 2014-10-17T00:53:21 arm: Deref ffi_align argument
Richard Henderson c129bea8 2014-10-15T17:28:53 arm: Reindent arm/ffi.c
Matthias Klose aaf3101b 2014-09-20T06:37:04 Fix -Werror=declaration-after-statement problem
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 66469c38 2014-01-09T13:41:45 Darwin/ARM: Inhibit Clang previous prototype warnings
Anthony Green 3dc3f32c 2013-12-05T16:23:25 Undo iOS ARM64 changes.
Zachary Waldowski 16ba1b80 2012-04-11T23:26:04 Darwin: Silence Clang warnings.
Anthony Green 2f450822 2013-11-18T06:52:29 Clean up code to appease modern GCC compiler.
David Schneider 77f823e3 2013-11-13T14:26:57 stop trying to assing vfp regs once we are done with the registers
David Schneider 37067ec5 2013-11-12T19:49:01 mark all vfp registers as used when done. To avoid assigning registers the would fit, once arguments have been on the stack, we mark all registers as used once we do not find a free register for the first time.
Anthony Green c2422174 2013-11-02T14:08:23 Merge pull request #45 from foss-for-synopsys-dwc-arc-processors/arc_support arc: Fix build error
Anthony Green 128cd1d2 2013-10-08T06:45:51 Fix spelling errors
David Schneider b4112098 2013-03-27T16:38:35 create separated versions of ffi_prep_incoming_args_* for SYSV and VFP ABIs. The different versions will be called depending on the value of cif->abi
David Schneider 9708e7cf 2013-03-27T19:31:04 folow the ARM hard-float ABI in ffi_prep_incoming_args_VFP
David Schneider 3c160861 2013-03-26T19:24:47 extend ffi_prepare_args for FFI_VFP (hard-float ABI), fixing an issue with passing VFP arguments in VFP registers and the stack, while at the same time not using all core registers.
David Schneider 0f2ff2d4 2013-03-26T19:22:02 separate ARM ffi_prepare_args in a version implementing the simple SYSV calling convention and one for the hard-float calling convention
David Schneider 3a352b8a 2013-03-26T14:24:04 move the hardfloat specific argument copying code to the helper function
David Schneider 5df6b794 2013-03-26T14:02:21 extract setting of arguments to be passed to a helper function
David Schneider 7d1048c4 2013-03-26T11:33:33 extract code to align the argument storage pointer to a helper function
Anthony Green e1539266 2012-03-30T00:40:18 ARM VFP fix for old toolchains
Anthony Green ff9454da 2011-11-12T17:18:51 Add David Gilbert's variadic function call support
Anthony Green 322052ce 2011-11-12T16:11:49 Fix arm wince alignment issue
Anthony Green 3d56106b 2011-11-12T07:20:24 Rebase
Anthony Green d992ac54 2011-07-29T17:32:53 Refresh from GCC
Anthony Green 1fbf9dc4 2011-02-13T08:06:39 Fix bad_abi test. rc5.
Anthony Green 0cad4386 2011-02-09T06:11:46 Add ChangeLog entry. Fix copyright headers.
Anthony Green 1106229a 2011-02-08T19:20:09 Add iOS support
Anthony Green 2db72615 2010-11-21T10:50:56 Rebase
Landon Fuller 83038cf2 2010-09-19T14:36:45 Implement FFI_EXEC_TRAMPOLINE_TABLE allocator for iOS/ARM. This provides working closure support on iOS/ARM devices where PROT_WRITE|PROT_EXEC is not permitted. The code passes basic smoke tests, but requires further review.
Landon Fuller 9e119644 2010-09-19T10:43:06 Add a hard-coded FFI_EXEC_TRAMPOLINE_TABLE arm implementation. This implements support for re-mapping a shared table of executable trampolines directly in front of a writable configuration page, working around PROT_WRITE restrictions for sandboxed applications on Apple's iOS. This implementation is for testing purposes; a proper allocator is still necessary, and ARM-specific code needs to be moved out of src/closures.c.
Anthony Green c6dddbd0 2009-10-04T08:11:33 Initial commit