From b2585d98b2ec2bb45cba229cf558c3c7a6cbdda7 Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Wed, 13 Mar 2019 09:51:24 +0000 Subject: [PATCH] winebuild: Use the correct section label on macOS. Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- 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 1d4f217ae1d..603b6e2b072 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 634c933bfea..bd55bb2fa5c 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 d0c147df59b..65c8d144e3d 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 beff2ab135a..a1cc9aabd41 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)