winebuild: Set the default entry point also for Windows builds.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47410
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2019-06-25 17:36:44 +02:00
parent 0b709c5d85
commit 907896fba5
2 changed files with 10 additions and 10 deletions

View File

@ -456,15 +456,6 @@ static void add_undef_import( const char *name, int is_ordinal )
add_import_func( import, xstrdup( p ), NULL, ordinal, 0 ); add_import_func( import, xstrdup( p ), NULL, ordinal, 0 );
} }
/* get the default entry point for a given spec file */
static const char *get_default_entry_point( const DLLSPEC *spec )
{
if (spec->characteristics & IMAGE_FILE_DLL) return "__wine_spec_dll_entry";
if (spec->subsystem == IMAGE_SUBSYSTEM_NATIVE) return "__wine_spec_drv_entry";
if (spec->type == SPEC_WIN16) return "__wine_spec_exe16_entry";
return "__wine_spec_exe_entry";
}
/* check if the spec file exports any stubs */ /* check if the spec file exports any stubs */
static int has_stubs( const DLLSPEC *spec ) static int has_stubs( const DLLSPEC *spec )
{ {
@ -480,7 +471,6 @@ static int has_stubs( const DLLSPEC *spec )
/* add the extra undefined symbols that will be contained in the generated spec file itself */ /* add the extra undefined symbols that will be contained in the generated spec file itself */
static void add_extra_undef_symbols( DLLSPEC *spec ) static void add_extra_undef_symbols( DLLSPEC *spec )
{ {
if (!spec->init_func) spec->init_func = xstrdup( get_default_entry_point(spec) );
add_extra_ld_symbol( spec->init_func ); add_extra_ld_symbol( spec->init_func );
if (has_stubs( spec )) add_extra_ld_symbol( "__wine_spec_unimplemented_stub" ); if (has_stubs( spec )) add_extra_ld_symbol( "__wine_spec_unimplemented_stub" );
if (delayed_imports.count) add_extra_ld_symbol( "__wine_spec_delay_load" ); if (delayed_imports.count) add_extra_ld_symbol( "__wine_spec_delay_load" );

View File

@ -369,6 +369,15 @@ static void set_exec_mode( enum exec_mode_values mode )
exec_mode = mode; exec_mode = mode;
} }
/* get the default entry point for a given spec file */
static const char *get_default_entry_point( const DLLSPEC *spec )
{
if (spec->characteristics & IMAGE_FILE_DLL) return "__wine_spec_dll_entry";
if (spec->subsystem == IMAGE_SUBSYSTEM_NATIVE) return "__wine_spec_drv_entry";
if (spec->type == SPEC_WIN16) return "__wine_spec_exe16_entry";
return "__wine_spec_exe_entry";
}
/* parse options from the argv array and remove all the recognized ones */ /* parse options from the argv array and remove all the recognized ones */
static char **parse_options( int argc, char **argv, DLLSPEC *spec ) static char **parse_options( int argc, char **argv, DLLSPEC *spec )
{ {
@ -633,6 +642,7 @@ int main(int argc, char **argv)
case MODE_EXE: case MODE_EXE:
load_resources( argv, spec ); load_resources( argv, spec );
if (spec_file_name && !parse_input_file( spec )) break; if (spec_file_name && !parse_input_file( spec )) break;
if (!spec->init_func) spec->init_func = xstrdup( get_default_entry_point( spec ));
if (fake_module) if (fake_module)
{ {