<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libffi.git/src/closures.c, 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>arm64e: Pull in pointer authentication code from Apple's arm64e libffi port (#565)</title>
<updated>2021-03-24T18:38:36+00:00</updated>
<author>
<name>Jeremy Huddleston Sequoia</name>
<email>jeremyhu@users.noreply.github.com</email>
</author>
<published>2021-03-24T18:38:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libffi.git/commit/?id=eafab2356e8dcf5f01d2bcfa311cafba3b395a7e'/>
<id>eafab2356e8dcf5f01d2bcfa311cafba3b395a7e</id>
<content type='text'>
NOTES: This changes the ptrauth support from #548 to match what Apple is
       shipping in its libffi-27 tag.

Signed-off-by: Jeremy Huddleston Sequoia &lt;jeremyhu@apple.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
NOTES: This changes the ptrauth support from #548 to match what Apple is
       shipping in its libffi-27 tag.

Signed-off-by: Jeremy Huddleston Sequoia &lt;jeremyhu@apple.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Search $LIBFFI_TMPDIR also (#605)</title>
<updated>2021-03-23T23:03:45+00:00</updated>
<author>
<name>DJ Delorie</name>
<email>dj@delorie.com</email>
</author>
<published>2021-03-23T23:03:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libffi.git/commit/?id=70ea259c603e0f84eda766be29d4259f1e8fe5b7'/>
<id>70ea259c603e0f84eda766be29d4259f1e8fe5b7</id>
<content type='text'>
Most temp file directories need to be hardened against execution, but
libffi needs execute privileges.  Add a libffi-specific temp directory
that can be set up by sysadmins as needed with suitable permissions.
This both ensures that libffi will have a valid temp directory to use
as well as preventing attempts to access other directories.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Most temp file directories need to be hardened against execution, but
libffi needs execute privileges.  Add a libffi-specific temp directory
that can be set up by sysadmins as needed with suitable permissions.
This both ensures that libffi will have a valid temp directory to use
as well as preventing attempts to access other directories.</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>Use memfd_create() (#604)</title>
<updated>2020-12-02T21:14:27+00:00</updated>
<author>
<name>DJ Delorie</name>
<email>dj@delorie.com</email>
</author>
<published>2020-12-02T21:14:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libffi.git/commit/?id=5c63b463b87d3c06102a4a7f05f395929d9ea79b'/>
<id>5c63b463b87d3c06102a4a7f05f395929d9ea79b</id>
<content type='text'>
memfd_create creates a file in a memory-only filesystem that may
bypass strict security protocols in filesystem-based temporary
files.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
memfd_create creates a file in a memory-only filesystem that may
bypass strict security protocols in filesystem-based temporary
files.</pre>
</div>
</content>
</entry>
<entry>
<title>Fix building for aarch64 windows with mingw toolchains (#555)</title>
<updated>2020-04-26T01:58:33+00:00</updated>
<author>
<name>Martin Storsjö</name>
<email>martin@martin.st</email>
</author>
<published>2020-04-26T01:58:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libffi.git/commit/?id=c06468fa6674d3783a0edb1d0fae9afc8bc28513'/>
<id>c06468fa6674d3783a0edb1d0fae9afc8bc28513</id>
<content type='text'>
* aarch64: Check _WIN32 instead of _M_ARM64 for detecting windows

This fixes building for aarch64 with mingw toolchains. _M_ARM64 is
predefined by MSVC, while mingw compilers predefine __aarch64__.

In aarch64 specific code, change checks for _M_ARM64 into checks for
_WIN32.

In arch independent code, check for
(defined(_M_ARM64) || defined(__aarch64__)) &amp;&amp; defined(_WIN32)
instead of just _M_ARM64.

In src/closures.c, coalesce checks like
defined(X86_WIN32) || defined(X86_WIN64) || defined(_M_ARM64)
into plain defined(_WIN32). Technically, this enables code for
ARM32 windows where it wasn't, but as far as I can see it, those
codepaths should be fine for that architecture variant as well.

* aarch64: Only use armasm source when building with MSVC

When building for windows/arm64 with clang, the normal gas style .S
source works fine. sysv.S and win64_armasm.S seem to be functionally
equivalent, with only differences being due to assembler syntax.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* aarch64: Check _WIN32 instead of _M_ARM64 for detecting windows

This fixes building for aarch64 with mingw toolchains. _M_ARM64 is
predefined by MSVC, while mingw compilers predefine __aarch64__.

In aarch64 specific code, change checks for _M_ARM64 into checks for
_WIN32.

In arch independent code, check for
(defined(_M_ARM64) || defined(__aarch64__)) &amp;&amp; defined(_WIN32)
instead of just _M_ARM64.

In src/closures.c, coalesce checks like
defined(X86_WIN32) || defined(X86_WIN64) || defined(_M_ARM64)
into plain defined(_WIN32). Technically, this enables code for
ARM32 windows where it wasn't, but as far as I can see it, those
codepaths should be fine for that architecture variant as well.

* aarch64: Only use armasm source when building with MSVC

When building for windows/arm64 with clang, the normal gas style .S
source works fine. sysv.S and win64_armasm.S seem to be functionally
equivalent, with only differences being due to assembler syntax.</pre>
</div>
</content>
</entry>
<entry>
<title>Port to iOS/arm64e (#548)</title>
<updated>2020-03-10T01:05:42+00:00</updated>
<author>
<name>Ole André Vadla Ravnås</name>
<email>oleavr@gmail.com</email>
</author>
<published>2020-03-10T01:05:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libffi.git/commit/?id=4c7bde32ea3af479babdf527d94f241282951cb9'/>
<id>4c7bde32ea3af479babdf527d94f241282951cb9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Revamp PA_LINUX and PA_HPUX target closures to use function descriptors.</title>
<updated>2020-02-24T15:29:20+00:00</updated>
<author>
<name>Moxie Bot</name>
<email>bot@moxielogic.com</email>
</author>
<published>2020-02-24T15:29:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libffi.git/commit/?id=8eb2d2b05626b1cbbed100725bc440709499e8a6'/>
<id>8eb2d2b05626b1cbbed100725bc440709499e8a6</id>
<content type='text'>
	2020-02-23  John David Anglin  &lt;danglin@gcc.gnu.org&gt;

	* include/ffi.h.in (FFI_CLOSURE_PTR, FFI_RESTORE_PTR): Define.
	* src/closures.c (ffi_closure_alloc): Convert closure pointer
	return by malloc to function pointer.
	(ffi_closure_free): Convert function pointer back to malloc pointer.
	* src/pa/ffi.c (ffi_closure_inner_pa32): Use union to double word
	align return address on stack.  Adjust statements referencing return
	address.  Convert closure argument from function pointer to standard
	closure pointer.
	(ffi_prep_closure_loc): Likewise convert closure argument back to
	closure pointer.  Remove assembler trampolines.  Setup simulated
	function descriptor as on ia64.
	src/pa/ffitarget.h (FFI_TRAMPOLINE_SIZE): Reduce to 12.
	src/pa/hpux32.S (ffi_closure_pa32): Retrieve closure pointer and real
	gp from fake gp value in register %r19.
	src/pa/linux.S (ffi_closure_pa32): Likewise.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	2020-02-23  John David Anglin  &lt;danglin@gcc.gnu.org&gt;

	* include/ffi.h.in (FFI_CLOSURE_PTR, FFI_RESTORE_PTR): Define.
	* src/closures.c (ffi_closure_alloc): Convert closure pointer
	return by malloc to function pointer.
	(ffi_closure_free): Convert function pointer back to malloc pointer.
	* src/pa/ffi.c (ffi_closure_inner_pa32): Use union to double word
	align return address on stack.  Adjust statements referencing return
	address.  Convert closure argument from function pointer to standard
	closure pointer.
	(ffi_prep_closure_loc): Likewise convert closure argument back to
	closure pointer.  Remove assembler trampolines.  Setup simulated
	function descriptor as on ia64.
	src/pa/ffitarget.h (FFI_TRAMPOLINE_SIZE): Reduce to 12.
	src/pa/hpux32.S (ffi_closure_pa32): Retrieve closure pointer and real
	gp from fake gp value in register %r19.
	src/pa/linux.S (ffi_closure_pa32): Likewise.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add work-around for users who manage their own closure memory</title>
<updated>2019-11-20T11:15:55+00:00</updated>
<author>
<name>Anthony Green</name>
<email>green@moxielogic.com</email>
</author>
<published>2019-11-20T11:15:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libffi.git/commit/?id=31543c799a224ef446cef19a2372b054ecad3822'/>
<id>31543c799a224ef446cef19a2372b054ecad3822</id>
<content type='text'>
As suggested by DJ
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As suggested by DJ
</pre>
</div>
</content>
</entry>
<entry>
<title>handle compilation warnings with ftruncate API (#508)</title>
<updated>2019-10-08T13:16:47+00:00</updated>
<author>
<name>pnallan</name>
<email>46887249+pnallan@users.noreply.github.com</email>
</author>
<published>2019-10-08T13:16:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libffi.git/commit/?id=55c22092dc54e706a64af3a49ae9d5471a9e8317'/>
<id>55c22092dc54e706a64af3a49ae9d5471a9e8317</id>
<content type='text'>
* fix me: avoid warning while handle ftruncate API

Signed-off-by: Prasad Nallani &lt;prasad.nallani@intel.com&gt;

* Update closures.c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* fix me: avoid warning while handle ftruncate API

Signed-off-by: Prasad Nallani &lt;prasad.nallani@intel.com&gt;

* Update closures.c
</pre>
</div>
</content>
</entry>
<entry>
<title> libffi: added ARM64 support for Windows (#486)</title>
<updated>2019-06-26T02:01:22+00:00</updated>
<author>
<name>ossdev07</name>
<email>39188636+ossdev07@users.noreply.github.com</email>
</author>
<published>2019-06-26T02:01:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libffi.git/commit/?id=d856743e6b02fcb5911491204131e277a7a4e10b'/>
<id>d856743e6b02fcb5911491204131e277a7a4e10b</id>
<content type='text'>
*  libffi: added ARM64 support for Windows

    1. ported sysv.S to win64_armasm.S for armasm64 assembler
    2. added msvc_build folder for visual studio solution
    3. updated README.md for the same
    4. MSVC solution created with the changes, and below test suites are tested
       with test script written in python.

       libffi.bhaible
       libffi.call
    5. Basic functionality of above test suites are getting passed

Signed-off-by: ossdev07 &lt;ossdev@puresoftware.com&gt;

* Update README.md
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
*  libffi: added ARM64 support for Windows

    1. ported sysv.S to win64_armasm.S for armasm64 assembler
    2. added msvc_build folder for visual studio solution
    3. updated README.md for the same
    4. MSVC solution created with the changes, and below test suites are tested
       with test script written in python.

       libffi.bhaible
       libffi.call
    5. Basic functionality of above test suites are getting passed

Signed-off-by: ossdev07 &lt;ossdev@puresoftware.com&gt;

* Update README.md
</pre>
</div>
</content>
</entry>
</feed>
