From: Rémi Bernon rbernon@codeweavers.com
This fixes incorrect .text section flags for any module using delay imports. The use of a custom .text$2 section as dlltool is doing causes the section to be flagged as DATA, and ends up with the .text section being writable, which triggers the anti tamper used in Forza Horizon. --- tools/winebuild/import.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index 14ee27c2f18..273f5848ad4 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -1680,7 +1680,7 @@ static void build_windows_import_lib( const char *lib_name, DLLSPEC *spec ) output_function_size( delay_load ); output_gnu_stack_note();
- output( "\n\t.section ".text$2"\n" ); + output( "\t.data\n" ); output( ".L__wine_delay_import_desc:\n" ); output( "\t.long 1\n" ); /* DllAttributes */ output_rva( "%s\n", asm_name( import_name ) ); /* DllNameRVA */ @@ -1691,7 +1691,6 @@ static void build_windows_import_lib( const char *lib_name, DLLSPEC *spec ) output( "\t.long 0\n"); /* UnloadInformationTableRVA */ output( "\t.long 0\n"); /* TimeDateStamp */
- output( "\t.data\n" ); output( ".L__wine_delay_import_handle:\n" ); output( "\t%s 0\n", get_asm_ptr_keyword() ); }