Store a relative pointer for registry entry points to avoid some text

relocations.
oldstable
Alexandre Julliard 2005-06-16 11:04:41 +00:00
parent 7da043f869
commit efcc2b83d8
3 changed files with 7 additions and 4 deletions

View File

@ -675,11 +675,13 @@ void WINAPI __regs_RELAY_CallFrom32Regs( CONTEXT86 *context )
args_copy[nb_args] = (int)context; /* append context argument */
if (relay->ret == 0xc3) /* cdecl */
{
call_cdecl_function( *(LONGLONG_CPROC *)(entry_point + 5), nb_args+1, args_copy );
call_cdecl_function( (LONGLONG_CPROC)(entry_point + 5 + *(DWORD *)(entry_point + 5)),
nb_args+1, args_copy );
}
else /* stdcall */
{
call_stdcall_function( *(LONGLONG_FARPROC *)(entry_point + 5), nb_args+1, args_copy );
call_stdcall_function( (LONGLONG_FARPROC)(entry_point + 5 + *(DWORD *)(entry_point + 5)),
nb_args+1, args_copy );
}
if (TRACE_ON(relay))

View File

@ -241,7 +241,7 @@ struct statvfs
#define DEFINE_REGS_ENTRYPOINT( name, args, pop_args ) \
__ASM_GLOBAL_FUNC( name, \
"call " __ASM_NAME("__wine_call_from_32_regs") "\n\t" \
".long " __ASM_NAME("__regs_") #name "\n\t" \
".long " __ASM_NAME("__regs_") #name "-.\n\t" \
".byte " #args "," #pop_args )
/* FIXME: add support for other CPUs */
#endif /* __i386__ */

View File

@ -1012,7 +1012,8 @@ static void BuildCallFrom32Regs( FILE *outfile )
/* Call the entry point */
fprintf( outfile, "\tcall *0(%%ebx)\n" );
fprintf( outfile, "\taddl (%%ebx),%%ebx\n" );
fprintf( outfile, "\tcall *%%ebx\n" );
fprintf( outfile, "\tleal -%d(%%ebp),%%ecx\n", STACK_SPACE );
/* Restore the context structure */