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: libffi merge


Timothy Wall wrote:
> 
>> @@ -311,13 +315,26 @@
>> ({ unsigned char *__tramp = (unsigned char*)(TRAMP); \
>>    unsigned int  __fun = (unsigned int)(FUN); \
>>    unsigned int  __ctx = (unsigned int)(CTX); \
>> -   unsigned int  __dis = __fun - (__ctx + FFI_TRAMPOLINE_SIZE); \
>> +   unsigned int  __dis = __fun - (__ctx + 10);    \
>>    *(unsigned char*) &__tramp[0] = 0xb8; \
>>    *(unsigned int*)  &__tramp[1] = __ctx; /* movl __ctx, %eax */ \
>>    *(unsigned char *)  &__tramp[5] = 0xe9; \
>>    *(unsigned int*)  &__tramp[6] = __dis; /* jmp __fun  */ \
>>  })
>>
> 
> The above change looks like it was missed in the gcc patch.  While
> FFI_TRAMPOLINE_SIZE is "10", the offset added to __ctx is an instruction
> displacement, NOT the size of the trampoline.

Yes, I understand that the offset should be 10, not FFI_TRAMPOLINE_SIZE.
I'm going to make sure that gcc's libffi has that change.  But until I
can get a reply from Dave that explains what's going on I'm not going to
touch anything.

Andrew.


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