diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h index a445be9333..c100b2cda9 100644 --- a/tools/winebuild/build.h +++ b/tools/winebuild/build.h @@ -176,6 +176,7 @@ extern const char *get_asm_short_keyword(void); extern const char *get_asm_rodata_section(void); extern const char *get_asm_string_section(void); extern void output_function_size( FILE *outfile, const char *name ); +extern void output_gnu_stack_note( FILE *outfile ); extern void add_import_dll( const char *name, const char *filename ); extern void add_delayed_import( const char *name ); diff --git a/tools/winebuild/relay.c b/tools/winebuild/relay.c index 8d304d0ed0..6900294a49 100644 --- a/tools/winebuild/relay.c +++ b/tools/winebuild/relay.c @@ -982,6 +982,7 @@ void BuildRelays16( FILE *outfile ) fprintf( outfile, "%s\n\t.long 0\n", asm_globl("CallTo16_DataSelector") ); fprintf( outfile, "%s\n\t.long 0\n", asm_globl("CallTo16_TebSelector") ); if (UsePIC) fprintf( outfile, "wine_ldt_copy_ptr:\t.long %s\n", asm_name("wine_ldt_copy") ); + output_gnu_stack_note( outfile ); } /******************************************************************* @@ -1007,4 +1008,5 @@ void BuildRelays32( FILE *outfile ) BuildCallFrom32Regs( outfile ); output_function_size( outfile, "__wine_spec_thunk_text_32" ); + output_gnu_stack_note( outfile ); } diff --git a/tools/winebuild/spec16.c b/tools/winebuild/spec16.c index c8a1026b4e..d3b4ef35bd 100644 --- a/tools/winebuild/spec16.c +++ b/tools/winebuild/spec16.c @@ -804,6 +804,7 @@ void BuildSpec16File( FILE *outfile, DLLSPEC *spec ) output_stubs( outfile, spec ); output_get_pc_thunk( outfile ); output_init_code( outfile, spec, header_name ); + output_gnu_stack_note( outfile ); free( typelist ); } diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c index 963e916b51..aa1ce3d25d 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -479,6 +479,7 @@ void BuildSpec32File( FILE *outfile, DLLSPEC *spec ) output_imports( outfile, spec ); output_resources( outfile, spec ); output_asm_constructor( outfile, "__wine_spec_init_ctor" ); + output_gnu_stack_note( outfile ); } diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c index 8fb3acce4b..8ba3cf8ff7 100644 --- a/tools/winebuild/utils.c +++ b/tools/winebuild/utils.c @@ -533,6 +533,20 @@ void output_function_size( FILE *outfile, const char *name ) } } +/* output the GNU note for non-exec stack */ +void output_gnu_stack_note( FILE *outfile ) +{ + switch (target_platform) + { + case PLATFORM_WINDOWS: + case PLATFORM_APPLE: + break; + default: + fprintf( outfile, "\t.section .note.GNU-stack,\"\",@progbits\n" ); + break; + } +} + /* return a global symbol declaration for an assembly symbol */ const char *asm_globl( const char *func ) {