winebuild: Output the module filename along with the stub data.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2019-03-06 10:10:49 +01:00
parent 0cdab409ad
commit a3229faf59
2 changed files with 16 additions and 30 deletions

View File

@ -1187,14 +1187,14 @@ static void output_external_link_imports( DLLSPEC *spec )
void output_stubs( DLLSPEC *spec ) void output_stubs( DLLSPEC *spec )
{ {
const char *name, *exp_name; const char *name, *exp_name;
int i, count; int i;
if (!has_stubs( spec )) return; if (!has_stubs( spec )) return;
output( "\n/* stub functions */\n\n" ); output( "\n/* stub functions */\n\n" );
output( "\t.text\n" ); output( "\t.text\n" );
for (i = count = 0; i < spec->nb_entry_points; i++) for (i = 0; i < spec->nb_entry_points; i++)
{ {
ORDDEF *odp = &spec->entry_points[i]; ORDDEF *odp = &spec->entry_points[i];
if (odp->type != TYPE_STUB) continue; if (odp->type != TYPE_STUB) continue;
@ -1231,7 +1231,6 @@ void output_stubs( DLLSPEC *spec )
{ {
output( "\tleal .L%s_string-1b(%%eax),%%ecx\n", name ); output( "\tleal .L%s_string-1b(%%eax),%%ecx\n", name );
output( "\tmovl %%ecx,4(%%esp)\n" ); output( "\tmovl %%ecx,4(%%esp)\n" );
count++;
} }
else else
output( "\tmovl $%d,4(%%esp)\n", odp->ordinal ); output( "\tmovl $%d,4(%%esp)\n", odp->ordinal );
@ -1241,10 +1240,7 @@ void output_stubs( DLLSPEC *spec )
else else
{ {
if (exp_name) if (exp_name)
{
output( "\tmovl $.L%s_string,4(%%esp)\n", name ); output( "\tmovl $.L%s_string,4(%%esp)\n", name );
count++;
}
else else
output( "\tmovl $%d,4(%%esp)\n", odp->ordinal ); output( "\tmovl $%d,4(%%esp)\n", odp->ordinal );
output( "\tmovl $.L__wine_spec_file_name,(%%esp)\n" ); output( "\tmovl $.L__wine_spec_file_name,(%%esp)\n" );
@ -1256,10 +1252,7 @@ void output_stubs( DLLSPEC *spec )
output_cfi( ".cfi_adjust_cfa_offset 8" ); output_cfi( ".cfi_adjust_cfa_offset 8" );
output( "\tleaq .L__wine_spec_file_name(%%rip),%%rdi\n" ); output( "\tleaq .L__wine_spec_file_name(%%rip),%%rdi\n" );
if (exp_name) if (exp_name)
{
output( "leaq .L%s_string(%%rip),%%rsi\n", name ); output( "leaq .L%s_string(%%rip),%%rsi\n", name );
count++;
}
else else
output( "\tmovq $%d,%%rsi\n", odp->ordinal ); output( "\tmovq $%d,%%rsi\n", odp->ordinal );
output( "\tcall %s\n", asm_name("__wine_spec_unimplemented_stub") ); output( "\tcall %s\n", asm_name("__wine_spec_unimplemented_stub") );
@ -1269,24 +1262,19 @@ void output_stubs( DLLSPEC *spec )
output( "\tadd r0,PC\n"); output( "\tadd r0,PC\n");
output( "\tldr r1,2f+4\n"); output( "\tldr r1,2f+4\n");
output( "1:" ); output( "1:" );
if (exp_name) if (exp_name) output( "\tadd r1,PC\n");
{
output( "\tadd r1,PC\n");
count++;
}
output( "\tbl %s\n", asm_name("__wine_spec_unimplemented_stub") ); output( "\tbl %s\n", asm_name("__wine_spec_unimplemented_stub") );
output( "2:\t.long .L__wine_spec_file_name-1b\n" ); output( "2:\t.long .L__wine_spec_file_name-1b\n" );
if (exp_name) output( "\t.long .L%s_string-2b\n", name ); if (exp_name) output( "\t.long .L%s_string-2b\n", name );
else output( "\t.long %u\n", odp->ordinal ); else output( "\t.long %u\n", odp->ordinal );
break; break;
case CPU_ARM64: case CPU_ARM64:
output( "\tadrp x0, %s\n", asm_name("__wine_spec_file_name") ); output( "\tadrp x0, .L__wine_spec_file_name\n" );
output( "\tadd x0, x0, #:lo12:%s\n", asm_name("__wine_spec_file_name") ); output( "\tadd x0, x0, #:lo12:.L__wine_spec_file_name\n" );
if (exp_name) if (exp_name)
{ {
output( "\tadrp x1, .L%s_string\n", name ); output( "\tadrp x1, .L%s_string\n", name );
output( "\tadd x1, x1, #:lo12:.L%s_string\n", name ); output( "\tadd x1, x1, #:lo12:.L%s_string\n", name );
count++;
} }
else else
output( "\tmov x1, %u\n", odp->ordinal ); output( "\tmov x1, %u\n", odp->ordinal );
@ -1301,9 +1289,9 @@ void output_stubs( DLLSPEC *spec )
output_function_size( name ); output_function_size( name );
} }
if (count)
{
output( "\t%s\n", get_asm_string_section() ); output( "\t%s\n", get_asm_string_section() );
output( ".L__wine_spec_file_name:\n" );
output( "\t%s \"%s\"\n", get_asm_string_keyword(), spec->file_name );
for (i = 0; i < spec->nb_entry_points; i++) for (i = 0; i < spec->nb_entry_points; i++)
{ {
ORDDEF *odp = &spec->entry_points[i]; ORDDEF *odp = &spec->entry_points[i];
@ -1317,7 +1305,6 @@ void output_stubs( DLLSPEC *spec )
} }
} }
} }
}
/* output the import and delayed import tables of a Win32 module */ /* output the import and delayed import tables of a Win32 module */
void output_imports( DLLSPEC *spec ) void output_imports( DLLSPEC *spec )

View File

@ -685,7 +685,6 @@ void output_module( DLLSPEC *spec )
output( "\n\t%s\n", get_asm_string_section() ); output( "\n\t%s\n", get_asm_string_section() );
output( "%s\n", asm_globl("__wine_spec_file_name") ); output( "%s\n", asm_globl("__wine_spec_file_name") );
output( ".L__wine_spec_file_name:\n" );
output( "\t%s \"%s\"\n", get_asm_string_keyword(), spec->file_name ); output( "\t%s \"%s\"\n", get_asm_string_keyword(), spec->file_name );
if (target_platform == PLATFORM_APPLE) if (target_platform == PLATFORM_APPLE)
output( "\t.lcomm %s,4\n", asm_name("_end") ); output( "\t.lcomm %s,4\n", asm_name("_end") );