mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-02 09:23:39 +00:00
winebuild: Generate a separate helper for each delay-imported module.
This commit is contained in:
parent
0c39285077
commit
a2d8e7a5d3
|
@ -1031,8 +1031,14 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
|
|||
output( "\t.text\n" );
|
||||
output( "\t.align %d\n", get_alignment(8) );
|
||||
output( "%s:\n", asm_name(delayed_import_loaders));
|
||||
output( "\t%s\n", func_declaration("__wine_delay_load_asm") );
|
||||
output( "%s:\n", asm_name("__wine_delay_load_asm") );
|
||||
|
||||
idx = 0;
|
||||
LIST_FOR_EACH_ENTRY( import, &dll_delayed, struct import, entry )
|
||||
{
|
||||
char *module_func = strmake( "__wine_delay_load_asm_%s", import->c_name );
|
||||
output( "\t.align %d\n", get_alignment(4) );
|
||||
output( "\t%s\n", func_declaration(module_func) );
|
||||
output( "%s:\n", asm_name(module_func) );
|
||||
output_cfi( ".cfi_startproc" );
|
||||
switch (target.cpu)
|
||||
{
|
||||
|
@ -1107,12 +1113,9 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
|
|||
break;
|
||||
}
|
||||
output_cfi( ".cfi_endproc" );
|
||||
output_function_size( "__wine_delay_load_asm" );
|
||||
output_function_size( module_func );
|
||||
output( "\n" );
|
||||
|
||||
idx = 0;
|
||||
LIST_FOR_EACH_ENTRY( import, &dll_delayed, struct import, entry )
|
||||
{
|
||||
for (j = 0; j < import->nb_imports; j++)
|
||||
{
|
||||
struct import_func *func = &import->imports[j];
|
||||
|
@ -1126,12 +1129,12 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
|
|||
case CPU_i386:
|
||||
case CPU_x86_64:
|
||||
output( "\tmovl $%d,%%eax\n", (idx << 16) | j );
|
||||
output( "\tjmp %s\n", asm_name("__wine_delay_load_asm") );
|
||||
output( "\tjmp %s\n", asm_name(module_func) );
|
||||
break;
|
||||
case CPU_ARM:
|
||||
output( "\tmov ip, #%u\n", j );
|
||||
if (idx) output( "\tmovt ip, #%u\n", idx );
|
||||
output( "\tb %s\n", asm_name("__wine_delay_load_asm") );
|
||||
output( "\tb %s\n", asm_name(module_func) );
|
||||
break;
|
||||
case CPU_ARM64:
|
||||
if (idx)
|
||||
|
@ -1140,7 +1143,7 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
|
|||
if (j) output( "\tmovk x16, #0x%x\n", j );
|
||||
}
|
||||
else output( "\tmov x16, #0x%x\n", j );
|
||||
output( "\tb %s\n", asm_name("__wine_delay_load_asm") );
|
||||
output( "\tb %s\n", asm_name(module_func) );
|
||||
break;
|
||||
}
|
||||
output_cfi( ".cfi_endproc" );
|
||||
|
|
Loading…
Reference in a new issue