|
78556561
|
2020-02-21T19:08:06
|
|
x86: Add indirect branch tracking support (#540)
Intel Control-flow Enforcement Technology (CET):
https://software.intel.com/en-us/articles/intel-sdm
contains shadow stack (SHSTK) and indirect branch tracking (IBT). When
CET is enabled, ELF object files must be marked with .note.gnu.property
section. When Intel CET is enabled, include <cet.h> in assembly codes
to mark Intel CET support.
Also when IBT is enabled, all indirect branch targets must start with
ENDBR instruction and notrack prefix can be used to disable IBT on
indirect branch. <cet.h> defines _CET_ENDBR which can be used in
assembly codes for ENDBR instruction. If <cet.h> isn't included,
define _CET_ENDBR as empty so that _CET_ENDBR can be used in assembly
codes.
Trampoline must be enlarged to add ENDBR instruction unconditionally,
which is NOP on non-CET processors. This is required regardless if
libffi is enabled with CET since libffi.so will be marked in legacy
bitmap, but trampoline won't. Update library version for larger
FFI_TRAMPOLINE_SIZE.
This fixed:
https://github.com/libffi/libffi/issues/474
Tested with
$ CC="gcc -Wl,-z,cet-report=error -fcf-protection" CXX="g++ -Wl,-z,cet-report=error -fcf-protection" .../configure
on Linux CET machines in i686, x32 and x86-64 modes.
|
|
05a17964
|
2019-02-19T04:11:28
|
|
Cleanup symbol exports on darwin and add architecture preprocessor checks to assist in building fat binaries (eg: i386+x86_64 on macOS or arm+aarch64 on iOS) (#450)
* x86: Ensure _efi64 suffixed symbols are not exported
* x86: Ensure we do not export ffi_prep_cif_machdep
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* x86: Ensure we don't export ffi_call_win64, ffi_closure_win64, or ffi_go_closure_win64
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* closures: Silence a semantic warning
libffi/src/closures.c:175:23: This function declaration is not a prototype
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* aarch64: Ensure we don't export ffi_prep_cif_machdep
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* arm: Ensure we don't export ffi_prep_cif_machdep
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* aarch64, arm, x86: Add architecture preprocessor checks to support easier fat builds (eg: iOS)
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* x86: Silence some static analysis warnings
libffi/src/x86/ffi64.c:286:21: The left operand of '!=' is a garbage value due to array index out of bounds
libffi/src/x86/ffi64.c:297:22: The left operand of '!=' is a garbage value due to array index out of bounds
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* aarch: Use FFI_HIDDEN rather than .hidden
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* ffi.h: Don't advertise ffi_java_rvalue_to_raw, ffi_prep_java_raw_closure, and ffi_prep_java_raw_closure_loc when FFI_NATIVE_RAW_API is 0
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
|
|
b5ee3957
|
2018-05-05T07:41:53
|
|
Revert "Remove some symbol exports and cleanup newline warnings (#433)"
This reverts commit a5a0f3cf36dfb4d64316414a872288c3170e6c1d.
|
|
a5a0f3cf
|
2018-05-05T03:44:33
|
|
Remove some symbol exports and cleanup newline warnings (#433)
* build: Ensure darwin generated sources end with a new line
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
* build: Use .private_extern where missing to prevent exporting symbols that are not API
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
|
|
d15581c6
|
2017-12-01T00:34:30
|
|
Updating calls to ffi_closure_unix64_inner and ffi_closure_win64_inner to 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)'
|
|
794a54d4
|
2016-06-05T14:57:00
|
|
Mark win64.S with GNU-stack note
|
|
92810b4b
|
2016-05-26T08:56:51
|
|
[Darwin-x86, build] Fix up label prefixes, remove .purgem
Darwin uses a label prefix of _.
cctools assembler will not accept .purgem as a directive.
|
|
e5843a3a
|
2016-04-15T16:10:08
|
|
x86: Fix calling convention for ffi_closure_win64_inner
Also enable testing for the cross-abi calls.
|
|
d0675197
|
2016-03-07T12:14:22
|
|
x86: Copy fix for clang .org from unix64.S
Clang doesn't understand .org with symbolic operands.
|
|
eaa59755
|
2015-07-26T17:17:16
|
|
src/x86/win64.S: Handle name mangling and PIC
Move the macros from unix64.S into a shared header asmnames.h and use
them in win64.S too.
|
|
c8e82d9f
|
2015-07-26T16:18:57
|
|
src/x86/win64.S: Support compiling on non-WIN64 platforms
Non-WIN64 versions of the GNU assembler don't support the .seh_*
directives for structured exception handling, so wrap them in a macro
that compiles to nothing.
Handle the registers used for the non-Windows x86-64 calling convention
when on a non-Windows platform. Distinguish between cases that should
refer to the native argument registers (defined as arg0, arg1, arg2, and
arg3) and cases that should always refer to the Windows argument
registers.
|
|
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.
|
|
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.
|
|
5b9cd527
|
2010-11-22T15:19:57
|
|
win64-underscore patch
|
|
c6dddbd0
|
2009-10-04T08:11:33
|
|
Initial commit
|