[PATCH] winebuild: Use the correct section label on macOS.

Huw Davies huw at codeweavers.com
Wed Mar 13 04:51:24 CDT 2019


Signed-off-by: Huw Davies <huw at codeweavers.com>
---
 tools/winebuild/build.h  |  2 ++
 tools/winebuild/res32.c  |  2 +-
 tools/winebuild/spec32.c |  2 +-
 tools/winebuild/utils.c  | 20 ++++++++++++++++++++
 4 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h
index 1d4f217ae1..603b6e2b07 100644
--- a/tools/winebuild/build.h
+++ b/tools/winebuild/build.h
@@ -281,7 +281,9 @@ extern const char *func_declaration( const char *func );
 extern const char *asm_globl( const char *func );
 extern const char *get_asm_ptr_keyword(void);
 extern const char *get_asm_string_keyword(void);
+extern const char *get_asm_export_section(void);
 extern const char *get_asm_rodata_section(void);
+extern const char *get_asm_rsrc_section(void);
 extern const char *get_asm_string_section(void);
 extern void output_function_size( const char *name );
 extern void output_gnu_stack_note(void);
diff --git a/tools/winebuild/res32.c b/tools/winebuild/res32.c
index 634c933bfe..bd55bb2fa5 100644
--- a/tools/winebuild/res32.c
+++ b/tools/winebuild/res32.c
@@ -441,7 +441,7 @@ void output_resources( DLLSPEC *spec )
     /* output the resource directories */
 
     output( "\n/* resources */\n\n" );
-    output( "\t.section %s\n", target_platform == PLATFORM_WINDOWS ? ".rsrc" : ".data" );
+    output( "\t%s\n", get_asm_rsrc_section() );
     output( "\t.align %d\n", get_alignment(get_ptr_size()) );
     output( ".L__wine_spec_resources:\n" );
 
diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c
index d0c147df59..65c8d144e3 100644
--- a/tools/winebuild/spec32.c
+++ b/tools/winebuild/spec32.c
@@ -384,7 +384,7 @@ void output_exports( DLLSPEC *spec )
     if (!nr_exports) return;
 
     output( "\n/* export table */\n\n" );
-    output( "\t.section %s\n", target_platform == PLATFORM_WINDOWS ? ".edata" : ".data" );
+    output( "\t%s\n", get_asm_export_section() );
     output( "\t.align %d\n", get_alignment(4) );
     output( ".L__wine_spec_exports:\n" );
 
diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c
index beff2ab135..a1cc9aabd4 100644
--- a/tools/winebuild/utils.c
+++ b/tools/winebuild/utils.c
@@ -1201,6 +1201,16 @@ const char *get_asm_string_keyword(void)
     }
 }
 
+const char *get_asm_export_section(void)
+{
+    switch (target_platform)
+    {
+    case PLATFORM_APPLE:   return ".data";
+    case PLATFORM_WINDOWS: return ".section .edata";
+    default:               return ".section .data";
+    }
+}
+
 const char *get_asm_rodata_section(void)
 {
     switch (target_platform)
@@ -1210,6 +1220,16 @@ const char *get_asm_rodata_section(void)
     }
 }
 
+const char *get_asm_rsrc_section(void)
+{
+    switch (target_platform)
+    {
+    case PLATFORM_APPLE:   return ".data";
+    case PLATFORM_WINDOWS: return ".section .rsrc";
+    default:               return ".section .data";
+    }
+}
+
 const char *get_asm_string_section(void)
 {
     switch (target_platform)
-- 
2.18.0




More information about the wine-devel mailing list