Commit ce635744 authored by Alexandre Julliard's avatar Alexandre Julliard

winebuild: Generate stub entry points for x86_64.

parent 24d3b1f6
...@@ -1192,45 +1192,64 @@ void output_stubs( DLLSPEC *spec ) ...@@ -1192,45 +1192,64 @@ void output_stubs( DLLSPEC *spec )
output( "\t%s\n", func_declaration(name) ); output( "\t%s\n", func_declaration(name) );
output( "%s:\n", asm_name(name) ); output( "%s:\n", asm_name(name) );
/* flesh out the stub a bit to make safedisc happy */ switch (target_cpu)
output(" \tnop\n" );
output(" \tnop\n" );
output(" \tnop\n" );
output(" \tnop\n" );
output(" \tnop\n" );
output(" \tnop\n" );
output(" \tnop\n" );
output(" \tnop\n" );
output(" \tnop\n" );
output( "\tsubl $4,%%esp\n" );
if (UsePIC)
{ {
output( "\tcall %s\n", asm_name("__wine_spec_get_pc_thunk_eax") ); case CPU_x86:
output( "1:" ); /* flesh out the stub a bit to make safedisc happy */
if (exp_name) output(" \tnop\n" );
output(" \tnop\n" );
output(" \tnop\n" );
output(" \tnop\n" );
output(" \tnop\n" );
output(" \tnop\n" );
output(" \tnop\n" );
output(" \tnop\n" );
output(" \tnop\n" );
output( "\tsubl $4,%%esp\n" );
if (UsePIC)
{ {
output( "\tleal .L%s_string-1b(%%eax),%%ecx\n", name ); output( "\tcall %s\n", asm_name("__wine_spec_get_pc_thunk_eax") );
output( "1:" );
if (exp_name)
{
output( "\tleal .L%s_string-1b(%%eax),%%ecx\n", name );
output( "\tpushl %%ecx\n" );
count++;
}
else
output( "\tpushl $%d\n", odp->ordinal );
output( "\tleal .L__wine_spec_file_name-1b(%%eax),%%ecx\n" );
output( "\tpushl %%ecx\n" ); output( "\tpushl %%ecx\n" );
count++;
} }
else else
output( "\tpushl $%d\n", odp->ordinal ); {
output( "\tleal .L__wine_spec_file_name-1b(%%eax),%%ecx\n" ); if (exp_name)
output( "\tpushl %%ecx\n" ); {
} output( "\tpushl $.L%s_string\n", name );
else count++;
{ }
else
output( "\tpushl $%d\n", odp->ordinal );
output( "\tpushl $.L__wine_spec_file_name\n" );
}
output( "\tcall %s\n", asm_name("__wine_spec_unimplemented_stub") );
break;
case CPU_x86_64:
output( "\tleaq .L__wine_spec_file_name(%%rip),%%rdi\n" );
if (exp_name) if (exp_name)
{ {
output( "\tpushl $.L%s_string\n", name ); output( "leaq .L%s_string(%%rip),%%rsi\n", name );
count++; count++;
} }
else else
output( "\tpushl $%d\n", odp->ordinal ); output( "\tmovq $%d,%%rsi\n", odp->ordinal );
output( "\tpushl $.L__wine_spec_file_name\n" ); output( "\tsubq $8,%%rsp\n" );
output( "\tcall %s\n", asm_name("__wine_spec_unimplemented_stub") );
break;
default:
assert(0);
} }
output( "\tcall %s\n", asm_name("__wine_spec_unimplemented_stub") );
output_function_size( name ); output_function_size( name );
} }
......
...@@ -377,7 +377,7 @@ static int parse_spec_stub( ORDDEF *odp, DLLSPEC *spec ) ...@@ -377,7 +377,7 @@ static int parse_spec_stub( ORDDEF *odp, DLLSPEC *spec )
{ {
odp->u.func.arg_types[0] = '\0'; odp->u.func.arg_types[0] = '\0';
odp->link_name = xstrdup(""); odp->link_name = xstrdup("");
odp->flags |= FLAG_CPU(CPU_x86); /* don't bother generating stubs for Winelib */ odp->flags |= FLAG_CPU(CPU_x86) | FLAG_CPU(CPU_x86_64); /* don't bother generating stubs for Winelib */
return 1; return 1;
} }
......
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