This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Re: src/alpha/ffitarget.h - FFI_TRAMPOLINE_SIZE
- From: Jarkko Hietaniemi <jhi at iki dot fi>
- To: libffi-discuss at sourceware dot org
- Date: Thu, 16 Apr 2015 06:58:10 -0400
- Subject: Re: src/alpha/ffitarget.h - FFI_TRAMPOLINE_SIZE
- Authentication-results: sourceware.org; auth=none
- References: <mgn9sa$lom$1 at ger dot gmane dot org>
- Reply-to: jhi at iki dot fi
On Wednesday-201504-15 23:20, John E. Malmberg wrote:
tramp = (unsigned int *) &closure->tramp[0];
....
*(void **) &tramp[4] = ffi_closure_osf;
But tramp only has 3 longword members per the previous declaration, so
&tramp[4] is the address of the '*cif' member of the structure which is
then updated:
unsigned int is four bytes in alpha. (LP64, not ILP64).
So writing an 8-byte ptr at int offset 4 or byte offset 16
will update the bytes 16 to 23. Verified in an alpha, and
for that matter in an x86_64, which is LP64, too.