This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: src/alpha/ffitarget.h - FFI_TRAMPOLINE_SIZE


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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]