summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* new test: return small structSergei Trofimovich2018-02-172-0/+58
| | | | | | | | | | | | | | | | | The bug originally was discovered in https://bugs.gentoo.org/634190 where complicated callback was returning invalid data on ia64. This change adds minimal reproducer that fails only on ia64 as: FAIL: libffi.call/struct10.c -W -Wall -Wno-psabi -O0 execution test FAIL: libffi.call/struct10.c -W -Wall -Wno-psabi -O2 execution test FAIL: libffi.call/struct10.c -W -Wall -Wno-psabi -O3 execution test FAIL: libffi.call/struct10.c -W -Wall -Wno-psabi -Os execution test Test passes on amd64. The fix is in the following commit. Bug: https://bugs.gentoo.org/634190 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Merge pull request #403 from frida/fix/x86-sysv-pic-closure-regressionAnthony Green2018-02-101-2/+2
|\ | | | | Fix x86 SysV closure in PIC mode
| * Fix x86 SysV closure in PIC modeOle André Vadla Ravnås2018-01-211-2/+2
| | | | | | | | | | | | | | The assembly single-line comments swallowed up the remaining assembly code of the macros due to lack of line-endings. This is a regression introduced in b7f6d7a.
* | Merge pull request #405 from andreas-schwab/masterAnthony Green2018-02-101-8/+31
|\ \ | |/ |/| Fix passing struct by value on aarch64
| * Fix passing struct by value on aarch64Andreas Schwab2018-02-071-8/+31
|/ | | | This fixes the ctypes test in the python testsuite.
* adjust env usage in travisAnthony Green2018-01-101-1/+3
|
* test static libAnthony Green2018-01-101-1/+2
|
* Merge pull request #393 from thejunkjon/masterAnthony Green2018-01-102-2/+2
|\ | | | | Linker error "recompile with -fPIC" for x86_64
| * Updating calls to ffi_closure_unix64_inner and ffi_closure_win64_inner to ↵jon2017-12-012-2/+2
| | | | | | | | use PLT. Without this fix, statically linking libffi causes the linker error i.e. 'requires dynamic R_X86_64_PC32 reloc against ffi_closure_unix64_inner which may overflow at runtime; recompile with -fPIC)'
* | Merge pull request #401 from wzssyqa/jr-r6Anthony Green2018-01-051-0/+8
|\ \ | | | | | | mips/ffi.c: fix encoding for jr on r6
| * | mips/ffi.c: fix encoding for jr on r6YunQiang Su2018-01-031-0/+8
|/ / | | | | mips/ffi.c: instruction jr has a different encoding for r6
* | Merge pull request #398 from emaste/masterAnthony Green2018-01-011-0/+6
|\ \ | | | | | | Enable symbol versioning when ld is LLVM's lld
| * | Enable symbol versioning when ld is LLVM's lldEd Maste2017-12-171-0/+6
| |/ | | | | | | Fixes #397
* | Merge pull request #396 from wzssyqa/masterAnthony Green2017-12-311-0/+2
|\ \ | |/ |/| mips/n32.S: disable .set mips4 on mips r6
| * Not set mips on mips r6YunQiang Su2017-12-101-0/+2
|/ | | | | MIPS release changed encodes of some instructions, include ll/sc etc. if .set mips4 on mips r6, as will generate some wrong encode of some instructions.
* Merge pull request #387 from trofi/masterAnthony Green2017-11-051-1/+1
|\ | | | | Makefile.am: add 'src/s390/internal.h' to source tarball
| * Makefile.am: add 'src/s390/internal.h' to source tarballSergei Trofimovich2017-11-051-1/+1
|/ | | | | | | | | | | | | | | | | | | commit 2f530de168e0253ac06e044c832132c496e8788b ("s390: Reorganize assembly") introduced new header (similar to other arches) but did not add it to source tarball. As a result build from 'make dist' tarballs failed as: ``` ../src/s390/ffi.c:34:10: fatal error: internal.h: No such file or directory #include "internal.h" ^~~~~~~~~~~~ ``` To fix it the change adds file to 'Makefile.am'. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Merge pull request #320 from 0-wiz-0/masterAnthony Green2017-11-031-0/+78
|\ | | | | Support NetBSD with mprotect.
| * Support NetBSD with mprotect.Joerg Sonnenberger2017-10-021-0/+78
| | | | | | | | Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
* | Merge pull request #322 from compnerd/aarch64-baseAnthony Green2017-11-033-2/+98
|\ \ | | | | | | aarch64: fix index base register for AArch64
| * | aarch64: fix index base register for AArch64Saleem Abdulrasool2017-10-263-2/+98
| | | | | | | | | | | | | | | The base is passed in `x3`, not in `x2`. This fixes the indexing base so that the right value is used.
* | | Merge pull request #384 from yan12125/fix-sgidefs-checkingAnthony Green2017-11-031-1/+1
|\ \ \ | |/ / |/| | Fix linux detection (closes #303)
| * | Fix linux detection (closes #303)Yen Chi Hsuan2017-10-271-1/+1
|/ /
* | Merge pull request #298 from frida/fix/ios-trampoline-table-complexityAnthony Green2017-10-250-0/+0
|\ \ | | | | | | Simplify iOS trampoline table allocation
| * | Simplify iOS trampoline table allocationOle André Vadla Ravnås2017-03-151-95/+63
| | | | | | | | | | | | | | | | | | By using VM_FLAGS_OVERWRITE there is no need for speculatively allocating on a page we just deallocated. This approach eliminates the race-condition and gets rid of the retry logic.
* | | Merge pull request #323 from compnerd/x86-alloca-alignmentAnthony Green2017-10-251-1/+3
|\ \ \ | | | | | | | | x86: align alloca to 16-byte boundary
| * | | x86: align alloca to 16-byte boundarySaleem Abdulrasool2017-10-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Align the stack allocation to a 16-byte boundary. This ensures that the stack parameters are 16-byte aligned which is needed for some instructions.
* | | | Merge pull request #379 from jlj/masterAnthony Green2017-10-255-23/+394
|\ \ \ \ | | | | | | | | | | Xcode build improvements
| * \ \ \ Merge branch 'master' based on ksjogo/libffiJean-Luc Jumpertz2017-10-235-23/+394
| |\ \ \ \ | | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a tvOS target in Xcode project. Misc Xcode project cleanup. Fix macOS build target in Xcode project. # Conflicts: # src/aarch64/ffi.c # src/x86/ffi64.c
| | * | | Added a tvOS target in Xcode project. Misc Xcode project cleanup.Jean-Luc Jumpertz2017-10-231-40/+208
| | | | |
| | * | | Fix macOS build target in Xcode project.Jean-Luc Jumpertz2017-09-045-17/+220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add missing files for desktop platforms in generate-darwin-source-and-headers.py, and in the Xcode project. - Add a static library target for macOS. - Fix "implicit conversion loses integer precision" warnings for iOS mad macOS targets.
* | | | | Merge pull request #383 from hjl-tools/hjl/masterAnthony Green2017-10-253-3/+36
|\ \ \ \ \ | | | | | | | | | | | | Hjl/master
| * | | | | Skip WIN64/EFI64 support for x32H.J. Lu2017-10-251-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | Since x32 doesn't support WIN64/EFI64, skip it if __ILP32__ is defined.
| * | | | | Don't include WIN64/EFI64 for x32H.J. Lu2017-10-252-3/+16
| |/ / / / | | | | | | | | | | | | | | | | | | | | Since x32 doesn't support WIN64/EFI64, don't include it for x32. Also x32 has sizeof size_t == 4. But TARGET should be X86_64.
* | | | | Merge pull request #381 from compnerd/ffi-nullptr-derefAnthony Green2017-10-251-1/+2
|\ \ \ \ \ | |/ / / / |/| | | | arm: fix a level of indirection issue
| * | | | arm: fix a level of indirection issueSaleem Abdulrasool2017-10-241-1/+2
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Merge pull request #326 from trofi/masterTom Tromey2017-10-171-0/+2
|\ \ \ \ | | | | | | | | | | src/ia64/unix.S: unbreak small struct handling
| * | | | src/ia64/unix.S: unbreak small struct handlingSergei Trofimovich2017-10-171-0/+2
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 6e8a4460833594d5af1b4539178025da0077df19 added FFI_TYPE_COMPLEX value type (comes after FFI_TYPE_POINTER) ia64 ffi_closure_unix reiles on the ordering of FFI_ enums as ia64 has ia64-specific FFI types: small struct and FPU extesions. As a result all tests handling small structs broke. The change fixes dispatch table by adding (no-op) FFI_TYPE_COMPLEX entry This has positive effect of unbreaking most tests on ia64: === libffi Summary === -# of expected passes 1595 -# of unexpected failures 295 +# of expected passes 1930 +# of unexpected failures 10 # of unsupported tests 30 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* | | | Merge pull request #324 from compnerd/arm-zextAnthony Green2017-10-101-0/+5
|\ \ \ \ | |_|_|/ |/| | | arm: zext return value parameters
| * | | arm: zext return value parametersSaleem Abdulrasool2017-10-101-0/+5
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #319 from angerman/patch-5Tom Tromey2017-10-011-0/+2
|\ \ \ | | | | | | | | Adds `local.exp` to DISTCLEANFILES
| * | | Change CLEANFILES to DISTCLEANFILESMoritz Angermann2017-10-021-1/+1
| | | |
| * | | Adds `local.exp` to CLEANFILESMoritz Angermann2017-10-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | With #315, #316, #317, #318 and this patch, running ``` AM_DISTCHECK_CONFIGURE_FLAGS=--disable-docs make distcheck ``` should complete successfully.
* | | | Merge pull request #316 from angerman/patch-2Tom Tromey2017-10-011-1/+1
|\ \ \ \ | | | | | | | | | | Add `configure.host` and `libtool-version` to the `EXTRA_DIST` files
| * \ \ \ MergedMoritz Angermann2017-10-011-1/+1
| |\ \ \ \
| | * | | | Include `libtool-version` in the EXTRA_DIST files.Moritz Angermann2017-10-011-1/+1
| | |/ / /
| * | | | Add `configure.host` to the `EXTRA_DIST` filesMoritz Angermann2017-10-011-1/+1
| |/ / / | | | | | | | | When running `make dist`, `configure.host` would not result in the distribution tarball, however `configure` would try to read it, and as such the tarball would not be buildable.
* | | | Merge pull request #317 from angerman/patch-3Tom Tromey2017-10-011-1/+1
|\ \ \ \ | |/ / / |/| | | Add src/x86/asmnames.h to noinst_HEADERS
| * | | Add src/x86/asmnames.h to noinst_HEADERSMoritz Angermann2017-10-011-1/+1
|/ / / | | | | | | In eaa59755fcbb692a8cb763c7f9f24a350aadbd30, macros from `unix64.S` were extracted into `asmnames.h` to be used with `win64.S` as well. As such these are required by `unix64.S`, which fails to build without them.
* | | Fix #265Anthony Green2017-09-272-2/+2
| | |