Commit a3229faf authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent 0cdab409
...@@ -1187,14 +1187,14 @@ static void output_external_link_imports( DLLSPEC *spec ) ...@@ -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 ) ...@@ -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 ) ...@@ -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 ) ...@@ -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 ) ...@@ -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,20 +1289,19 @@ void output_stubs( DLLSPEC *spec ) ...@@ -1301,20 +1289,19 @@ void output_stubs( DLLSPEC *spec )
output_function_size( name ); output_function_size( name );
} }
if (count) 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++)
{ {
output( "\t%s\n", get_asm_string_section() ); ORDDEF *odp = &spec->entry_points[i];
for (i = 0; i < spec->nb_entry_points; i++) if (odp->type != TYPE_STUB) continue;
exp_name = odp->name ? odp->name : odp->export_name;
if (exp_name)
{ {
ORDDEF *odp = &spec->entry_points[i]; name = get_stub_name( odp, spec );
if (odp->type != TYPE_STUB) continue; output( ".L%s_string:\n", name );
exp_name = odp->name ? odp->name : odp->export_name; output( "\t%s \"%s\"\n", get_asm_string_keyword(), exp_name );
if (exp_name)
{
name = get_stub_name( odp, spec );
output( ".L%s_string:\n", name );
output( "\t%s \"%s\"\n", get_asm_string_keyword(), exp_name );
}
} }
} }
} }
......
...@@ -685,7 +685,6 @@ void output_module( DLLSPEC *spec ) ...@@ -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") );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment