mirror of
git://source.winehq.org/git/wine.git
synced 2024-08-31 17:03:38 +00:00
winebuild: Add cfi annotations to the relay functions for i386.
This commit is contained in:
parent
eba56752fd
commit
5c2db41cdc
|
@ -386,13 +386,20 @@ static void BuildCallTo16Core( int reg_func )
|
|||
function_header( name );
|
||||
|
||||
/* Function entry sequence */
|
||||
output_cfi( ".cfi_startproc" );
|
||||
output( "\tpushl %%ebp\n" );
|
||||
output_cfi( ".cfi_adjust_cfa_offset 4" );
|
||||
output_cfi( ".cfi_rel_offset %%ebp,0" );
|
||||
output( "\tmovl %%esp, %%ebp\n" );
|
||||
output_cfi( ".cfi_def_cfa_register %%ebp" );
|
||||
|
||||
/* Save the 32-bit registers */
|
||||
output( "\tpushl %%ebx\n" );
|
||||
output_cfi( ".cfi_rel_offset %%ebx,-4" );
|
||||
output( "\tpushl %%esi\n" );
|
||||
output_cfi( ".cfi_rel_offset %%esi,-8" );
|
||||
output( "\tpushl %%edi\n" );
|
||||
output_cfi( ".cfi_rel_offset %%edi,-12" );
|
||||
output( "\t.byte 0x64\n\tmov %%gs,(%d)\n", GS_OFFSET );
|
||||
|
||||
/* Setup exception frame */
|
||||
|
@ -443,12 +450,18 @@ static void BuildCallTo16Core( int reg_func )
|
|||
|
||||
/* Restore the 32-bit registers */
|
||||
output( "\tpopl %%edi\n" );
|
||||
output_cfi( ".cfi_same_value %%edi" );
|
||||
output( "\tpopl %%esi\n" );
|
||||
output_cfi( ".cfi_same_value %%esi" );
|
||||
output( "\tpopl %%ebx\n" );
|
||||
output_cfi( ".cfi_same_value %%ebx" );
|
||||
|
||||
/* Function exit sequence */
|
||||
output( "\tpopl %%ebp\n" );
|
||||
output_cfi( ".cfi_def_cfa %%esp,4" );
|
||||
output_cfi( ".cfi_same_value %%ebp" );
|
||||
output( "\tret $12\n" );
|
||||
output_cfi( ".cfi_endproc" );
|
||||
|
||||
|
||||
/* Start of the actual CallTo16 routine */
|
||||
|
@ -652,11 +665,18 @@ static void BuildCallTo32CBClient( int isEx )
|
|||
|
||||
/* Entry code */
|
||||
|
||||
output_cfi( ".cfi_startproc" );
|
||||
output( "\tpushl %%ebp\n" );
|
||||
output_cfi( ".cfi_adjust_cfa_offset 4" );
|
||||
output_cfi( ".cfi_rel_offset %%ebp,0" );
|
||||
output( "\tmovl %%esp,%%ebp\n" );
|
||||
output_cfi( ".cfi_def_cfa_register %%ebp" );
|
||||
output( "\tpushl %%edi\n" );
|
||||
output_cfi( ".cfi_rel_offset %%edi,-4" );
|
||||
output( "\tpushl %%esi\n" );
|
||||
output_cfi( ".cfi_rel_offset %%esi,-8" );
|
||||
output( "\tpushl %%ebx\n" );
|
||||
output_cfi( ".cfi_rel_offset %%ebx,-12" );
|
||||
|
||||
/* Get pointer to temporary area and save the 32-bit stack pointer */
|
||||
|
||||
|
@ -694,10 +714,16 @@ static void BuildCallTo32CBClient( int isEx )
|
|||
/* Restore registers and return */
|
||||
|
||||
output( "\tpopl %%ebx\n" );
|
||||
output_cfi( ".cfi_same_value %%ebx" );
|
||||
output( "\tpopl %%esi\n" );
|
||||
output_cfi( ".cfi_same_value %%esi" );
|
||||
output( "\tpopl %%edi\n" );
|
||||
output_cfi( ".cfi_same_value %%edi" );
|
||||
output( "\tpopl %%ebp\n" );
|
||||
output_cfi( ".cfi_def_cfa %%esp,4" );
|
||||
output_cfi( ".cfi_same_value %%ebp" );
|
||||
output( "\tret\n" );
|
||||
output_cfi( ".cfi_endproc" );
|
||||
output_function_size( isEx ? "CALL32_CBClientEx" : "CALL32_CBClient" );
|
||||
|
||||
/* '16-bit' return stub */
|
||||
|
@ -757,8 +783,12 @@ static void build_call_from_regs_x86(void)
|
|||
|
||||
/* Allocate some buffer space on the stack */
|
||||
|
||||
output_cfi( ".cfi_startproc" );
|
||||
output( "\tpushl %%ebp\n" );
|
||||
output( "\tmovl %%esp,%%ebp\n ");
|
||||
output_cfi( ".cfi_adjust_cfa_offset 4" );
|
||||
output_cfi( ".cfi_rel_offset %%ebp,0" );
|
||||
output( "\tmovl %%esp,%%ebp\n" );
|
||||
output_cfi( ".cfi_def_cfa_register %%ebp" );
|
||||
output( "\tleal -%d(%%esp),%%esp\n", STACK_SPACE );
|
||||
|
||||
/* Build the context structure */
|
||||
|
@ -846,11 +876,14 @@ static void build_call_from_regs_x86(void)
|
|||
|
||||
output( "\tpopl %%ds\n" );
|
||||
output( "\tiret\n" );
|
||||
output_cfi( ".cfi_endproc" );
|
||||
output_function_size( "__wine_call_from_regs" );
|
||||
|
||||
function_header( "__wine_restore_regs" );
|
||||
output_cfi( ".cfi_startproc" );
|
||||
output( "\tmovl 4(%%esp),%%ecx\n" );
|
||||
output( "\tjmp 2b\n" );
|
||||
output_cfi( ".cfi_endproc" );
|
||||
output_function_size( "__wine_restore_regs" );
|
||||
}
|
||||
|
||||
|
|
|
@ -312,12 +312,17 @@ static void output_call16_function( ORDDEF *odp )
|
|||
output( "\t.align %d\n", get_alignment(4) );
|
||||
output( "\t%s\n", func_declaration(name) );
|
||||
output( "%s:\n", name );
|
||||
output_cfi( ".cfi_startproc" );
|
||||
output( "\tpushl %%ebp\n" );
|
||||
output_cfi( ".cfi_adjust_cfa_offset 4" );
|
||||
output_cfi( ".cfi_rel_offset %%ebp,0" );
|
||||
output( "\tmovl %%esp,%%ebp\n" );
|
||||
output_cfi( ".cfi_def_cfa_register %%ebp" );
|
||||
stack_words = 2;
|
||||
if (needs_ldt)
|
||||
{
|
||||
output( "\tpushl %%esi\n" );
|
||||
output_cfi( ".cfi_rel_offset %%esi,-4" );
|
||||
stack_words++;
|
||||
if (UsePIC)
|
||||
{
|
||||
|
@ -390,10 +395,16 @@ static void output_call16_function( ORDDEF *odp )
|
|||
|
||||
output( "\tcall *8(%%ebp)\n" );
|
||||
|
||||
if (needs_ldt) output( "\tmovl -4(%%ebp),%%esi\n" );
|
||||
|
||||
if (needs_ldt)
|
||||
{
|
||||
output( "\tmovl -4(%%ebp),%%esi\n" );
|
||||
output_cfi( ".cfi_same_value %%esi" );
|
||||
}
|
||||
output( "\tleave\n" );
|
||||
output_cfi( ".cfi_def_cfa %%esp,4" );
|
||||
output_cfi( ".cfi_same_value %%ebp" );
|
||||
output( "\tret\n" );
|
||||
output_cfi( ".cfi_endproc" );
|
||||
output_function_size( name );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue