winebuild: Disallow register functions in 32-bit modules.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2017-07-26 10:42:48 +02:00
parent ca20bddefc
commit 9fd4647977
2 changed files with 18 additions and 18 deletions

View File

@ -498,6 +498,18 @@ static const char *parse_spec_flags( DLLSPEC *spec, ORDDEF *odp )
error( "Unknown flag '%s'\n", token );
return NULL;
}
switch (1 << i)
{
case FLAG_RET16:
case FLAG_REGISTER:
if (spec->type == SPEC_WIN32)
error( "Flag '%s' is not supported in Win32\n", FlagNames[i] );
break;
case FLAG_RET64:
if (spec->type == SPEC_WIN16)
error( "Flag '%s' is not supported in Win16\n", FlagNames[i] );
break;
}
odp->flags |= 1 << i;
}
token = GetToken(0);

View File

@ -68,8 +68,6 @@ static inline int needs_relay( const ORDDEF *odp )
}
/* skip norelay and forward entry points */
if (odp->flags & (FLAG_NORELAY|FLAG_FORWARD)) return 0;
/* skip register entry points on x86_64 */
if (target_cpu == CPU_x86_64 && (odp->flags & FLAG_REGISTER)) return 0;
return 1;
}
@ -179,9 +177,6 @@ static void output_relay_debug( DLLSPEC *spec )
output( "\tpushl %%eax\n" );
flags |= 2;
}
if (odp->flags & FLAG_REGISTER)
output( "\tpushl %%eax\n" );
else
output( "\tpushl %%esp\n" );
output_cfi( ".cfi_adjust_cfa_offset 4" );
@ -199,19 +194,12 @@ static void output_relay_debug( DLLSPEC *spec )
output( "\tpushl %%eax\n" );
output_cfi( ".cfi_adjust_cfa_offset 4" );
if (odp->flags & FLAG_REGISTER)
{
output( "\tcall *8(%%eax)\n" );
}
else
{
output( "\tcall *4(%%eax)\n" );
output_cfi( ".cfi_adjust_cfa_offset -12" );
if (odp->type == TYPE_STDCALL || odp->type == TYPE_THISCALL)
output( "\tret $%u\n", args * get_ptr_size() );
else
output( "\tret\n" );
}
break;
case CPU_ARM: