<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libffi.git/src/x86, branch github-actions</title>
<subtitle>github.com: atgreen/libffi.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libffi.git/'/>
<entry>
<title>2021-06-15  Jakub Jelinek  &lt;jakub@redhat.com&gt;</title>
<updated>2021-06-15T19:24:24+00:00</updated>
<author>
<name>Jakub Jelinek</name>
<email>jakub@redhat.com</email>
</author>
<published>2021-06-15T19:19:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libffi.git/commit/?id=5651bea284ad0822eafe768e3443c2f4d7da2c8f'/>
<id>5651bea284ad0822eafe768e3443c2f4d7da2c8f</id>
<content type='text'>
        * src/x86/ffi64.c (classify_argument): For FFI_TYPE_STRUCT set words
        to number of words needed for type-&gt;size + byte_offset bytes rather
        than just type-&gt;size bytes.  Compute pos before the loop and check
        total size of the structure.
        * testsuite/libffi.call/nested_struct12.c: New test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
        * src/x86/ffi64.c (classify_argument): For FFI_TYPE_STRUCT set words
        to number of words needed for type-&gt;size + byte_offset bytes rather
        than just type-&gt;size bytes.  Compute pos before the loop and check
        total size of the structure.
        * testsuite/libffi.call/nested_struct12.c: New test.
</pre>
</div>
</content>
</entry>
<entry>
<title>x86: Fix thiscall and fastcall stack cleanup behavior (#611)</title>
<updated>2021-03-24T11:16:12+00:00</updated>
<author>
<name>Ole André Vadla Ravnås</name>
<email>oleavr@gmail.com</email>
</author>
<published>2021-03-24T11:16:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libffi.git/commit/?id=1aeb26714ec30649f5d9de5b4884a4ac46f5f474'/>
<id>1aeb26714ec30649f5d9de5b4884a4ac46f5f474</id>
<content type='text'>
These are meant to use callee clean-up.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These are meant to use callee clean-up.</pre>
</div>
</content>
</entry>
<entry>
<title>x86: Fix MSVC runtime checks interop (#612)</title>
<updated>2021-03-24T11:04:51+00:00</updated>
<author>
<name>Ole André Vadla Ravnås</name>
<email>oleavr@gmail.com</email>
</author>
<published>2021-03-24T11:04:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libffi.git/commit/?id=f88add14e40de398706c732e578620e8106062c7'/>
<id>f88add14e40de398706c732e578620e8106062c7</id>
<content type='text'>
MSVC can add runtime code that checks if a stack frame is mismanaged,
however our custom assembly deliberately accesses and modifies the parent
stack frame.  Fortunately we can disable that specific check for the
function call so do that.

Co-authored-by: Matthew Waters &lt;matthew@centricular.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
MSVC can add runtime code that checks if a stack frame is mismanaged,
however our custom assembly deliberately accesses and modifies the parent
stack frame.  Fortunately we can disable that specific check for the
function call so do that.

Co-authored-by: Matthew Waters &lt;matthew@centricular.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Static tramp v5 (#624)</title>
<updated>2021-03-05T16:07:30+00:00</updated>
<author>
<name>Madhavan T. Venkataraman</name>
<email>75220914+madvenka786@users.noreply.github.com</email>
</author>
<published>2021-03-05T16:07:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libffi.git/commit/?id=9ba559217bea0803263a9a9a0bafcf9203606f5b'/>
<id>9ba559217bea0803263a9a9a0bafcf9203606f5b</id>
<content type='text'>
* Static Trampolines

Closure Trampoline Security Issue
=================================

Currently, the trampoline code used in libffi is not statically defined in
a source file (except for MACH). The trampoline is either pre-defined
machine code in a data buffer. Or, it is generated at runtime. In order to
execute a trampoline, it needs to be placed in a page with executable
permissions.

Executable data pages are attack surfaces for attackers who may try to
inject their own code into the page and contrive to have it executed. The
security settings in a system may prevent various tricks used in user land
to write code into a page and to have it executed somehow. On such systems,
libffi trampolines would not be able to run.

Static Trampoline
=================

To solve this problem, the trampoline code needs to be defined statically
in a source file, compiled and placed in the text segment so it can be
mapped and executed naturally without any tricks. However, the trampoline
needs to be able to access the closure pointer at runtime.

PC-relative data referencing
============================

The solution implemented in this patch set uses PC-relative data references.
The trampoline is mapped in a code page. Adjacent to the code page, a data
page is mapped that contains the parameters of the trampoline:

	- the closure pointer
	- pointer to the ABI handler to jump to

The trampoline code uses an offset relative to its current PC to access its
data.

Some architectures support PC-relative data references in the ISA itself.
E.g., X64 supports RIP-relative references. For others, the PC has to
somehow be loaded into a general purpose register to do PC-relative data
referencing. To do this, we need to define a get_pc() kind of function and
call it to load the PC in a desired register.

There are two cases:

1. The call instruction pushes the return address on the stack.

   In this case, get_pc() will extract the return address from the stack
   and load it in the desired register and return.

2. The call instruction stores the return address in a designated register.

   In this case, get_pc() will copy the return address to the desired
   register and return.

Either way, the PC next to the call instruction is obtained.

Scratch register
================

In order to do its job, the trampoline code would need to use a scratch
register. Depending on the ABI, there may not be a register available for
scratch. This problem needs to be solved so that all ABIs will work.

The trampoline will save two values on the stack:

	- the closure pointer
	- the original value of the scratch register

This is what the stack will look like:

	sp before trampoline ------&gt;	--------------------
					| closure pointer  |
					--------------------
					| scratch register |
	sp after trampoline -------&gt;	--------------------

The ABI handler can do the following as needed by the ABI:

	- the closure pointer can be loaded in a desired register

	- the scratch register can be restored to its original value

	- the stack pointer can be restored to its original value
	  (the value when the trampoline was invoked)

To do this, I have defined prolog code for each ABI handler. The legacy
trampoline jumps to the ABI handler directly. But the static trampoline
defined in this patch jumps tp the prolog code which performs the above
actions before jumping to the ABI handler.

Trampoline Table
================

In order to reduce the trampoline memory footprint, the trampoline code
would be defined as a code array in the text segment. This array would be
mapped into the address space of the caller. The mapping would, therefore,
contain a trampoline table.

Adjacent to the trampoline table mapping, there will be a data mapping that
contains a parameter table, one parameter block for each trampoline. The
parameter block will contain:

	- a pointer to the closure
	- a pointer to the ABI handler

The static trampoline code would finally look like this:

	- Make space on the stack for the closure and the scratch register
	  by moving the stack pointer down
	- Store the original value of the scratch register on the stack
	- Using PC-relative reference, get the closure pointer
	- Store the closure pointer on the stack
	- Using PC-relative reference, get the ABI handler pointer
	- Jump to the ABI handler

Mapping size
============

The size of the code mapping that contains the trampoline table needs to be
determined on a per architecture basis. If a particular architecture
supports multiple base page sizes, then the largest supported base page size
needs to be chosen. E.g., we choose 16K for ARM64.

Trampoline allocation and free
==============================

Static trampolines are allocated in ffi_closure_alloc() and freed in
ffi_closure_free().

Normally, applications use these functions. But there are some cases out
there where the user of libffi allocates and manages its own closure
memory. In such cases, static trampolines cannot be used. These will
fall back to using legacy trampolines. The user has to make sure that
the memory is executable.

ffi_closure structure
=====================

I did not want to make any changes to the size of the closure structure for
this feature to guarantee compatibility. But the opaque static trampoline
handle needs to be stored in the closure. I have defined it as follows:

-  char tramp[FFI_TRAMPOLINE_SIZE];
+  union {
+    char tramp[FFI_TRAMPOLINE_SIZE];
+    void *ftramp;
+  };

If static trampolines are used, then tramp[] is not needed to store a
dynamic trampoline. That space can be reused to store the handle. Hence,
the union.

Architecture Support
====================

Support has been added for x64, i386, aarch64 and arm. Support for other
architectures can be added very easily in the future.

OS Support
==========

Support has been added for Linux. Support for other OSes can be added very
easily.

Signed-off-by: Madhavan T. Venkataraman &lt;madvenka@linux.microsoft.com&gt;

* x86: Support for Static Trampolines

	- Define the arch-specific initialization function ffi_tramp_arch ()
	  that returns trampoline size information to common code.

	- Define the trampoline code mapping and data mapping sizes.

	- Define the trampoline code table statically. Define two tables,
	  actually, one with CET and one without.

	- Introduce a tiny prolog for each ABI handling function. The ABI
	  handlers addressed are:

	  	- ffi_closure_unix64
		- ffi_closure_unix64_sse
		- ffi_closure_win64

	  The prolog functions are called:

		- ffi_closure_unix64_alt
		- ffi_closure_unix64_sse_alt
		- ffi_closure_win64_alt

	  The legacy trampoline jumps to the ABI handler. The static
	  trampoline jumps to the prolog function. The prolog function uses
	  the information provided by the static trampoline, sets things up
	  for the ABI handler and then jumps to the ABI handler.

	- Call ffi_tramp_set_parms () in ffi_prep_closure_loc () to
	  initialize static trampoline parameters.

Signed-off-by: Madhavan T. Venkataraman &lt;madvenka@linux.microsoft.com&gt;

* i386: Support for Static Trampolines

	- Define the arch-specific initialization function ffi_tramp_arch ()
	  that returns trampoline size information to common code.

	- Define the trampoline code table statically. Define two tables,
	  actually, one with CET and one without.

	- Define the trampoline code table statically.

	- Introduce a tiny prolog for each ABI handling function. The ABI
	  handlers addressed are:

	  	- ffi_closure_i386
		- ffi_closure_STDCALL
		- ffi_closure_REGISTER

	  The prolog functions are called:

	  	- ffi_closure_i386_alt
		- ffi_closure_STDCALL_alt
		- ffi_closure_REGISTER_alt

	  The legacy trampoline jumps to the ABI handler. The static
	  trampoline jumps to the prolog function. The prolog function uses
	  the information provided by the static trampoline, sets things up
	  for the ABI handler and then jumps to the ABI handler.

	- Call ffi_tramp_set_parms () in ffi_prep_closure_loc () to
	  initialize static trampoline parameters.

Signed-off-by: Madhavan T. Venkataraman &lt;madvenka@linux.microsoft.com&gt;

* arm64: Support for Static Trampolines

	- Define the arch-specific initialization function ffi_tramp_arch ()
	  that returns trampoline size information to common code.

	- Define the trampoline code mapping and data mapping sizes.

	- Define the trampoline code table statically.

	- Introduce a tiny prolog for each ABI handling function. The ABI
	  handlers addressed are:

	  	- ffi_closure_SYSV
		- ffi_closure_SYSV_V

	  The prolog functions are called:

	  	- ffi_closure_SYSV_alt
		- ffi_closure_SYSV_V_alt

	  The legacy trampoline jumps to the ABI handler. The static
	  trampoline jumps to the prolog function. The prolog function uses
	  the information provided by the static trampoline, sets things up
	  for the ABI handler and then jumps to the ABI handler.

	- Call ffi_tramp_set_parms () in ffi_prep_closure_loc () to
	  initialize static trampoline parameters.

Signed-off-by: Madhavan T. Venkataraman &lt;madvenka@linux.microsoft.com&gt;

* arm: Support for Static Trampolines

	- Define the arch-specific initialization function ffi_tramp_arch ()
	  that returns trampoline size information to common code.

	- Define the trampoline code mapping and data mapping sizes.

	- Define the trampoline code table statically.

	- Introduce a tiny prolog for each ABI handling function. The ABI
	  handlers addressed are:

	  	- ffi_closure_SYSV
		- ffi_closure_VFP

	  The prolog functions are called:

	  	- ffi_closure_SYSV_alt
		- ffi_closure_VFP_alt

	  The legacy trampoline jumps to the ABI handler. The static
	  trampoline jumps to the prolog function. The prolog function uses
	  the information provided by the static trampoline, sets things up
	  for the ABI handler and then jumps to the ABI handler.

	- Call ffi_tramp_set_parms () in ffi_prep_closure_loc () to
	  initialize static trampoline parameters.

Signed-off-by: Madhavan T. Venkataraman &lt;madvenka@linux.microsoft.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Static Trampolines

Closure Trampoline Security Issue
=================================

Currently, the trampoline code used in libffi is not statically defined in
a source file (except for MACH). The trampoline is either pre-defined
machine code in a data buffer. Or, it is generated at runtime. In order to
execute a trampoline, it needs to be placed in a page with executable
permissions.

Executable data pages are attack surfaces for attackers who may try to
inject their own code into the page and contrive to have it executed. The
security settings in a system may prevent various tricks used in user land
to write code into a page and to have it executed somehow. On such systems,
libffi trampolines would not be able to run.

Static Trampoline
=================

To solve this problem, the trampoline code needs to be defined statically
in a source file, compiled and placed in the text segment so it can be
mapped and executed naturally without any tricks. However, the trampoline
needs to be able to access the closure pointer at runtime.

PC-relative data referencing
============================

The solution implemented in this patch set uses PC-relative data references.
The trampoline is mapped in a code page. Adjacent to the code page, a data
page is mapped that contains the parameters of the trampoline:

	- the closure pointer
	- pointer to the ABI handler to jump to

The trampoline code uses an offset relative to its current PC to access its
data.

Some architectures support PC-relative data references in the ISA itself.
E.g., X64 supports RIP-relative references. For others, the PC has to
somehow be loaded into a general purpose register to do PC-relative data
referencing. To do this, we need to define a get_pc() kind of function and
call it to load the PC in a desired register.

There are two cases:

1. The call instruction pushes the return address on the stack.

   In this case, get_pc() will extract the return address from the stack
   and load it in the desired register and return.

2. The call instruction stores the return address in a designated register.

   In this case, get_pc() will copy the return address to the desired
   register and return.

Either way, the PC next to the call instruction is obtained.

Scratch register
================

In order to do its job, the trampoline code would need to use a scratch
register. Depending on the ABI, there may not be a register available for
scratch. This problem needs to be solved so that all ABIs will work.

The trampoline will save two values on the stack:

	- the closure pointer
	- the original value of the scratch register

This is what the stack will look like:

	sp before trampoline ------&gt;	--------------------
					| closure pointer  |
					--------------------
					| scratch register |
	sp after trampoline -------&gt;	--------------------

The ABI handler can do the following as needed by the ABI:

	- the closure pointer can be loaded in a desired register

	- the scratch register can be restored to its original value

	- the stack pointer can be restored to its original value
	  (the value when the trampoline was invoked)

To do this, I have defined prolog code for each ABI handler. The legacy
trampoline jumps to the ABI handler directly. But the static trampoline
defined in this patch jumps tp the prolog code which performs the above
actions before jumping to the ABI handler.

Trampoline Table
================

In order to reduce the trampoline memory footprint, the trampoline code
would be defined as a code array in the text segment. This array would be
mapped into the address space of the caller. The mapping would, therefore,
contain a trampoline table.

Adjacent to the trampoline table mapping, there will be a data mapping that
contains a parameter table, one parameter block for each trampoline. The
parameter block will contain:

	- a pointer to the closure
	- a pointer to the ABI handler

The static trampoline code would finally look like this:

	- Make space on the stack for the closure and the scratch register
	  by moving the stack pointer down
	- Store the original value of the scratch register on the stack
	- Using PC-relative reference, get the closure pointer
	- Store the closure pointer on the stack
	- Using PC-relative reference, get the ABI handler pointer
	- Jump to the ABI handler

Mapping size
============

The size of the code mapping that contains the trampoline table needs to be
determined on a per architecture basis. If a particular architecture
supports multiple base page sizes, then the largest supported base page size
needs to be chosen. E.g., we choose 16K for ARM64.

Trampoline allocation and free
==============================

Static trampolines are allocated in ffi_closure_alloc() and freed in
ffi_closure_free().

Normally, applications use these functions. But there are some cases out
there where the user of libffi allocates and manages its own closure
memory. In such cases, static trampolines cannot be used. These will
fall back to using legacy trampolines. The user has to make sure that
the memory is executable.

ffi_closure structure
=====================

I did not want to make any changes to the size of the closure structure for
this feature to guarantee compatibility. But the opaque static trampoline
handle needs to be stored in the closure. I have defined it as follows:

-  char tramp[FFI_TRAMPOLINE_SIZE];
+  union {
+    char tramp[FFI_TRAMPOLINE_SIZE];
+    void *ftramp;
+  };

If static trampolines are used, then tramp[] is not needed to store a
dynamic trampoline. That space can be reused to store the handle. Hence,
the union.

Architecture Support
====================

Support has been added for x64, i386, aarch64 and arm. Support for other
architectures can be added very easily in the future.

OS Support
==========

Support has been added for Linux. Support for other OSes can be added very
easily.

Signed-off-by: Madhavan T. Venkataraman &lt;madvenka@linux.microsoft.com&gt;

* x86: Support for Static Trampolines

	- Define the arch-specific initialization function ffi_tramp_arch ()
	  that returns trampoline size information to common code.

	- Define the trampoline code mapping and data mapping sizes.

	- Define the trampoline code table statically. Define two tables,
	  actually, one with CET and one without.

	- Introduce a tiny prolog for each ABI handling function. The ABI
	  handlers addressed are:

	  	- ffi_closure_unix64
		- ffi_closure_unix64_sse
		- ffi_closure_win64

	  The prolog functions are called:

		- ffi_closure_unix64_alt
		- ffi_closure_unix64_sse_alt
		- ffi_closure_win64_alt

	  The legacy trampoline jumps to the ABI handler. The static
	  trampoline jumps to the prolog function. The prolog function uses
	  the information provided by the static trampoline, sets things up
	  for the ABI handler and then jumps to the ABI handler.

	- Call ffi_tramp_set_parms () in ffi_prep_closure_loc () to
	  initialize static trampoline parameters.

Signed-off-by: Madhavan T. Venkataraman &lt;madvenka@linux.microsoft.com&gt;

* i386: Support for Static Trampolines

	- Define the arch-specific initialization function ffi_tramp_arch ()
	  that returns trampoline size information to common code.

	- Define the trampoline code table statically. Define two tables,
	  actually, one with CET and one without.

	- Define the trampoline code table statically.

	- Introduce a tiny prolog for each ABI handling function. The ABI
	  handlers addressed are:

	  	- ffi_closure_i386
		- ffi_closure_STDCALL
		- ffi_closure_REGISTER

	  The prolog functions are called:

	  	- ffi_closure_i386_alt
		- ffi_closure_STDCALL_alt
		- ffi_closure_REGISTER_alt

	  The legacy trampoline jumps to the ABI handler. The static
	  trampoline jumps to the prolog function. The prolog function uses
	  the information provided by the static trampoline, sets things up
	  for the ABI handler and then jumps to the ABI handler.

	- Call ffi_tramp_set_parms () in ffi_prep_closure_loc () to
	  initialize static trampoline parameters.

Signed-off-by: Madhavan T. Venkataraman &lt;madvenka@linux.microsoft.com&gt;

* arm64: Support for Static Trampolines

	- Define the arch-specific initialization function ffi_tramp_arch ()
	  that returns trampoline size information to common code.

	- Define the trampoline code mapping and data mapping sizes.

	- Define the trampoline code table statically.

	- Introduce a tiny prolog for each ABI handling function. The ABI
	  handlers addressed are:

	  	- ffi_closure_SYSV
		- ffi_closure_SYSV_V

	  The prolog functions are called:

	  	- ffi_closure_SYSV_alt
		- ffi_closure_SYSV_V_alt

	  The legacy trampoline jumps to the ABI handler. The static
	  trampoline jumps to the prolog function. The prolog function uses
	  the information provided by the static trampoline, sets things up
	  for the ABI handler and then jumps to the ABI handler.

	- Call ffi_tramp_set_parms () in ffi_prep_closure_loc () to
	  initialize static trampoline parameters.

Signed-off-by: Madhavan T. Venkataraman &lt;madvenka@linux.microsoft.com&gt;

* arm: Support for Static Trampolines

	- Define the arch-specific initialization function ffi_tramp_arch ()
	  that returns trampoline size information to common code.

	- Define the trampoline code mapping and data mapping sizes.

	- Define the trampoline code table statically.

	- Introduce a tiny prolog for each ABI handling function. The ABI
	  handlers addressed are:

	  	- ffi_closure_SYSV
		- ffi_closure_VFP

	  The prolog functions are called:

	  	- ffi_closure_SYSV_alt
		- ffi_closure_VFP_alt

	  The legacy trampoline jumps to the ABI handler. The static
	  trampoline jumps to the prolog function. The prolog function uses
	  the information provided by the static trampoline, sets things up
	  for the ABI handler and then jumps to the ABI handler.

	- Call ffi_tramp_set_parms () in ffi_prep_closure_loc () to
	  initialize static trampoline parameters.

Signed-off-by: Madhavan T. Venkataraman &lt;madvenka@linux.microsoft.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Allow to build with mingw-clang (#579)</title>
<updated>2020-11-10T11:41:33+00:00</updated>
<author>
<name>Mike Hommey</name>
<email>mh@glandium.org</email>
</author>
<published>2020-11-10T11:41:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libffi.git/commit/?id=8cc8f446f5aac13e107161dffbc15d1ee1a58878'/>
<id>8cc8f446f5aac13e107161dffbc15d1ee1a58878</id>
<content type='text'>
For some reason, compiling sysv.S with mingw-clang fails with:
```
error: invalid variant 'ffi_closure_inner@8'
```

This can be fixed (worked around?) by quoting the symbol. This works
fine with mingw-gcc too.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For some reason, compiling sysv.S with mingw-clang fails with:
```
error: invalid variant 'ffi_closure_inner@8'
```

This can be fixed (worked around?) by quoting the symbol. This works
fine with mingw-gcc too.</pre>
</div>
</content>
</entry>
<entry>
<title>Don't use FFI_TYPE_LONGDOUBLE in the jump table in win64*.S (#580)</title>
<updated>2020-11-10T11:39:25+00:00</updated>
<author>
<name>Mike Hommey</name>
<email>mh@glandium.org</email>
</author>
<published>2020-11-10T11:39:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libffi.git/commit/?id=d817d0daa312c58548d7a081aa876027ca103766'/>
<id>d817d0daa312c58548d7a081aa876027ca103766</id>
<content type='text'>
It may have the same value as FFI_TYPE_DOUBLE per ffi.h, which
possibly can make things go wrong with .org/ORG.

For instance, GCC complains about "Error: attempt to move .org
backwards"</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It may have the same value as FFI_TYPE_DOUBLE per ffi.h, which
possibly can make things go wrong with .org/ORG.

For instance, GCC complains about "Error: attempt to move .org
backwards"</pre>
</div>
</content>
</entry>
<entry>
<title>Support building x86 and arm64 without FFI_GO_CLOSURES (#586)</title>
<updated>2020-10-27T14:06:21+00:00</updated>
<author>
<name>Jeremy Huddleston Sequoia</name>
<email>jeremyhu@users.noreply.github.com</email>
</author>
<published>2020-10-27T14:06:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libffi.git/commit/?id=032b3cd6f7850f3ebc1269eeab7d1db3ea518d29'/>
<id>032b3cd6f7850f3ebc1269eeab7d1db3ea518d29</id>
<content type='text'>
* x86: Support building without FFI_GO_CLOSURES

Signed-off-by: Jeremy Huddleston Sequoia &lt;jeremyhu@apple.com&gt;

* arm: Support building without FFI_GO_CLOSURES

Signed-off-by: Jeremy Huddleston Sequoia &lt;jeremyhu@apple.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* x86: Support building without FFI_GO_CLOSURES

Signed-off-by: Jeremy Huddleston Sequoia &lt;jeremyhu@apple.com&gt;

* arm: Support building without FFI_GO_CLOSURES

Signed-off-by: Jeremy Huddleston Sequoia &lt;jeremyhu@apple.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Removing unnecessary instruction from ffi_call_unix64 (#588)</title>
<updated>2020-10-27T14:02:36+00:00</updated>
<author>
<name>petersn</name>
<email>schmidtnielsenpeter@gmail.com</email>
</author>
<published>2020-10-27T14:02:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libffi.git/commit/?id=c78fcf88ab13a5cc414826a018dd46c3f886adee'/>
<id>c78fcf88ab13a5cc414826a018dd46c3f886adee</id>
<content type='text'>
unix64.S's `ffi_call_unix64` looks like it used to take six parameters,
where the sixth said the number of SSE register arguments. However,
currently the function only takes five parameters, and the number of SSE
register arguments is encoded in the `struct register_args *` passed as
the first parameter to `ffi_call_unix64`. This change removes an
instruction that tries to use this missing sixth parameter as the number
of SSE arguments.

This fix should not change any behavior, nor fix any bugs, because a few
instructions later the value moved from %r9d into %eax is overwritten by
the correct value anyway. This change merely makes the code a tad less
confusing, because currently the assembly moves from a register (r9)
whose value is never set.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
unix64.S's `ffi_call_unix64` looks like it used to take six parameters,
where the sixth said the number of SSE register arguments. However,
currently the function only takes five parameters, and the number of SSE
register arguments is encoded in the `struct register_args *` passed as
the first parameter to `ffi_call_unix64`. This change removes an
instruction that tries to use this missing sixth parameter as the number
of SSE arguments.

This fix should not change any behavior, nor fix any bugs, because a few
instructions later the value moved from %r9d into %eax is overwritten by
the correct value anyway. This change merely makes the code a tad less
confusing, because currently the assembly moves from a register (r9)
whose value is never set.</pre>
</div>
</content>
</entry>
<entry>
<title>docs: fix simple typo, paramters -&gt; parameters (#589)</title>
<updated>2020-10-11T04:07:40+00:00</updated>
<author>
<name>Tim Gates</name>
<email>tim.gates@iress.com</email>
</author>
<published>2020-10-11T04:07:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libffi.git/commit/?id=407394c0aac2db4a1978a7691035889db9924a01'/>
<id>407394c0aac2db4a1978a7691035889db9924a01</id>
<content type='text'>
There is a small typo in src/x86/ffi.c.

Should read `parameters` rather than `paramters`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is a small typo in src/x86/ffi.c.

Should read `parameters` rather than `paramters`.</pre>
</div>
</content>
</entry>
<entry>
<title>x86: Fix ffi_prep_closure_loc (#542)</title>
<updated>2020-02-22T14:32:22+00:00</updated>
<author>
<name>hjl-tools</name>
<email>hjl.tools@gmail.com</email>
</author>
<published>2020-02-22T14:32:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libffi.git/commit/?id=d9abffeabe4f38bac12b864146cf974ede814411'/>
<id>d9abffeabe4f38bac12b864146cf974ede814411</id>
<content type='text'>
Since FFI_TRAMPOLINE_SIZE is increased by 4 bytes to add ENDBR32, adjust
jump displacement by 4 bytes.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since FFI_TRAMPOLINE_SIZE is increased by 4 bytes to add ENDBR32, adjust
jump displacement by 4 bytes.</pre>
</div>
</content>
</entry>
</feed>
