Alexandre Julliard : winebuild: Don't use a constructor for dll modules either.
Alexandre Julliard
julliard at winehq.org
Tue Apr 21 15:59:46 CDT 2020
Module: wine
Branch: master
Commit: 719324343124c96ba4b24bae1399f9903dc46768
URL: https://source.winehq.org/git/wine.git/?a=commit;h=719324343124c96ba4b24bae1399f9903dc46768
Author: Alexandre Julliard <julliard at winehq.org>
Date: Tue Apr 21 11:27:33 2020 +0200
winebuild: Don't use a constructor for dll modules either.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
tools/winebuild/main.c | 2 +-
tools/winebuild/parser.c | 2 +-
tools/winebuild/spec32.c | 45 ---------------------------------------------
3 files changed, 2 insertions(+), 47 deletions(-)
diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c
index d973a4e973..47f2787b10 100644
--- a/tools/winebuild/main.c
+++ b/tools/winebuild/main.c
@@ -389,7 +389,7 @@ static void set_exec_mode( enum exec_mode_values 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->characteristics & IMAGE_FILE_DLL) return "DllMain";
if (spec->subsystem == IMAGE_SUBSYSTEM_NATIVE) return "DriverEntry";
if (spec->type == SPEC_WIN16) return "__wine_spec_exe16_entry";
return "__wine_spec_exe_entry";
diff --git a/tools/winebuild/parser.c b/tools/winebuild/parser.c
index be705c25f0..0f2b9c1e10 100644
--- a/tools/winebuild/parser.c
+++ b/tools/winebuild/parser.c
@@ -829,7 +829,7 @@ void add_16bit_exports( DLLSPEC *spec32, DLLSPEC *spec16 )
if (spec16->characteristics & IMAGE_FILE_DLL)
{
spec32->characteristics = IMAGE_FILE_DLL;
- spec32->init_func = xstrdup( "__wine_spec_dll_entry" );
+ spec32->init_func = xstrdup( "DllMain" );
}
/* add an export for the NE module */
diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c
index 6e6f502e99..b1e20e0484 100644
--- a/tools/winebuild/spec32.c
+++ b/tools/winebuild/spec32.c
@@ -587,43 +587,6 @@ void output_exports( DLLSPEC *spec )
}
-/*******************************************************************
- * output_asm_constructor
- *
- * Output code for calling a dll constructor.
- */
-static void output_asm_constructor( const char *constructor )
-{
- if (target_platform == PLATFORM_APPLE)
- {
- /* Mach-O doesn't have an init section */
- output( "\n\t.mod_init_func\n" );
- output( "\t.align %d\n", get_alignment(get_ptr_size()) );
- output( "\t%s %s\n", get_asm_ptr_keyword(), asm_name(constructor) );
- }
- else
- {
- switch(target_cpu)
- {
- case CPU_x86:
- case CPU_x86_64:
- output( "\n\t.section \".init\",\"ax\"\n" );
- output( "\tcall %s\n", asm_name(constructor) );
- break;
- case CPU_ARM:
- output( "\n\t.section \".text\",\"ax\"\n" );
- output( "\tblx %s\n", asm_name(constructor) );
- break;
- case CPU_ARM64:
- case CPU_POWERPC:
- output( "\n\t.section \".init\",\"ax\"\n" );
- output( "\tbl %s\n", asm_name(constructor) );
- break;
- }
- }
-}
-
-
/*******************************************************************
* output_module
*
@@ -750,14 +713,6 @@ void output_module( DLLSPEC *spec )
output_data_directories( data_dirs );
- if (spec->characteristics & IMAGE_FILE_DLL)
- {
- output( "\n\t%s\n", get_asm_string_section() );
- output( "%s\n", asm_globl("__wine_spec_file_name") );
- output( "\t%s \"%s\"\n", get_asm_string_keyword(), spec->file_name );
- output_asm_constructor( "__wine_spec_init_ctor" );
- }
-
if (target_platform == PLATFORM_APPLE)
output( "\t.lcomm %s,4\n", asm_name("_end") );
}
More information about the wine-cvs
mailing list