From 7a15278504eec7b924c43993e120dc2733c4eeb4 Mon Sep 17 00:00:00 2001 From: Ge van Geldorp Date: Mon, 10 Jul 2006 08:58:59 +0200 Subject: [PATCH] winebuild: Save registers which might contain parameters for the function to be called. --- tools/winebuild/import.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index 3dcab2de49a..c06512ab1e7 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -932,10 +932,20 @@ static void output_delayed_import_thunks( FILE *outfile, const DLLSPEC *spec ) break; case CPU_x86_64: fprintf( outfile, "\tpushq %%rdi\n" ); + fprintf( outfile, "\tpushq %%rsi\n" ); + fprintf( outfile, "\tpushq %%rdx\n" ); + fprintf( outfile, "\tpushq %%rcx\n" ); + fprintf( outfile, "\tpushq %%r8\n" ); + fprintf( outfile, "\tpushq %%r9\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 %%r9\n" ); + fprintf( outfile, "\tpopq %%r8\n" ); + fprintf( outfile, "\tpopq %%rcx\n" ); + fprintf( outfile, "\tpopq %%rdx\n" ); + fprintf( outfile, "\tpopq %%rsi\n" ); fprintf( outfile, "\tpopq %%rdi\n" ); fprintf( outfile, "\tjmp *%%rax\n" ); break;