diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index 8c32b738a23..7d3c7252cc4 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -456,15 +456,6 @@ static void add_undef_import( const char *name, int is_ordinal ) 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 */ 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 */ 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 ); if (has_stubs( spec )) add_extra_ld_symbol( "__wine_spec_unimplemented_stub" ); if (delayed_imports.count) add_extra_ld_symbol( "__wine_spec_delay_load" ); diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c index 253957788a6..0a5becd870d 100644 --- a/tools/winebuild/main.c +++ b/tools/winebuild/main.c @@ -369,6 +369,15 @@ static void set_exec_mode( enum exec_mode_values 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 */ static char **parse_options( int argc, char **argv, DLLSPEC *spec ) { @@ -633,6 +642,7 @@ int main(int argc, char **argv) case MODE_EXE: load_resources( argv, spec ); 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) {