Commit 8c6649e4 authored by Alexandre Julliard's avatar Alexandre Julliard

Implemented import thunks for x86-64.

parent 6b5f290d
......@@ -619,7 +619,6 @@ static void output_import_thunk( FILE *outfile, const char *name, const char *ta
switch(target_cpu)
{
case CPU_x86_64: /* FIXME */
case CPU_x86:
if (!UsePIC)
{
......@@ -671,6 +670,9 @@ static void output_import_thunk( FILE *outfile, const char *name, const char *ta
}
}
break;
case CPU_x86_64:
fprintf( outfile, "\tjmpq *%s+%d(%%rip)\n", table, pos );
break;
case CPU_SPARC:
if ( !UsePIC )
{
......@@ -956,7 +958,6 @@ static void output_delayed_import_thunks( FILE *outfile, const DLLSPEC *spec )
fprintf( outfile, "%s:\n", asm_name("__wine_delay_load_asm") );
switch(target_cpu)
{
case CPU_x86_64: /* FIXME */
case CPU_x86:
fprintf( outfile, "\tpushl %%ecx\n" );
fprintf( outfile, "\tpushl %%edx\n" );
......@@ -966,6 +967,15 @@ static void output_delayed_import_thunks( FILE *outfile, const DLLSPEC *spec )
fprintf( outfile, "\tpopl %%ecx\n" );
fprintf( outfile, "\tjmp *%%eax\n" );
break;
case CPU_x86_64:
fprintf( outfile, "\tpushq %%rdi\n" );
fprintf( outfile, "\tsubq $8,%%rsp\n" );
fprintf( outfile, "\tmovq %%r11,%%rdi\n" );
fprintf( outfile, "\tcall %s\n", asm_name("__wine_spec_delay_load") );
fprintf( outfile, "\taddq $8,%%rsp\n" );
fprintf( outfile, "\tpopq %%rdi\n" );
fprintf( outfile, "\tjmp *%%rax\n" );
break;
case CPU_SPARC:
fprintf( outfile, "\tsave %%sp, -96, %%sp\n" );
fprintf( outfile, "\tcall %s\n", asm_name("__wine_spec_delay_load") );
......@@ -1041,11 +1051,14 @@ static void output_delayed_import_thunks( FILE *outfile, const DLLSPEC *spec )
fprintf( outfile, ".L__wine_delay_imp_%d_%s:\n", i, name );
switch(target_cpu)
{
case CPU_x86_64: /* FIXME */
case CPU_x86:
fprintf( outfile, "\tmovl $%d, %%eax\n", (idx << 16) | j );
fprintf( outfile, "\tjmp %s\n", asm_name("__wine_delay_load_asm") );
break;
case CPU_x86_64:
fprintf( outfile, "\tmovq $%d,%%r11\n", (idx << 16) | j );
fprintf( outfile, "\tjmp %s\n", asm_name("__wine_delay_load_asm") );
break;
case CPU_SPARC:
fprintf( outfile, "\tset %d, %%g1\n", (idx << 16) | j );
fprintf( outfile, "\tb,a %s\n", asm_name("__wine_delay_load_asm") );
......
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