Module: wine
Branch: master
Commit: 2e5e5ade82b5e3b1d70ebe6b1a824bdfdedfd04e
URL: https://gitlab.winehq.org/wine/wine/-/commit/2e5e5ade82b5e3b1d70ebe6b1a824b…
Author: Rémi Bernon <rbernon(a)codeweavers.com>
Date: Wed Nov 2 14:28:14 2022 +0100
winebuild: Put the delay import descriptor in data section.
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 | 1 -
1 file changed, 1 deletion(-)
diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c
index f5b87d76b05..c934e456cfe 100644
--- a/tools/winebuild/import.c
+++ b/tools/winebuild/import.c
@@ -1733,7 +1733,6 @@ static void build_windows_import_lib( const char *lib_name, DLLSPEC *spec, struc
output( ".L__wine_delay_import_handle:\n" );
output( "\t%s 0\n", get_asm_ptr_keyword() );
- output( "\n\t.section \".text$2\"\n" );
output( "%s\n", asm_globl( import_desc ) );
output( "\t.long 1\n" ); /* DllAttributes */
output_rva( "%s", asm_name( import_name ) ); /* DllNameRVA */
Module: wine
Branch: master
Commit: cfe83e80fc8bec7638c876032c4542cb7e667d10
URL: https://gitlab.winehq.org/wine/wine/-/commit/cfe83e80fc8bec7638c876032c4542…
Author: Rémi Bernon <rbernon(a)codeweavers.com>
Date: Sun Oct 2 22:08:53 2022 +0200
winebuild: Fix import hint value for symbols imported by name.
This fixes incorrect hint values generated by dlltool: instead of the
index in the name table, it used the ordinal value, which almost always
ends up in a hint lookup failure and a fallback to binary search.
---
tools/winebuild/import.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c
index cba88474b57..f5b87d76b05 100644
--- a/tools/winebuild/import.c
+++ b/tools/winebuild/import.c
@@ -1902,7 +1902,7 @@ static void build_windows_import_lib( const char *lib_name, DLLSPEC *spec, struc
{
output( "\n\t.section \".idata$6\"\n" );
output( ".L__wine_import_name:\n" );
- output( "\t.short %d\n", odp->ordinal );
+ output( "\t.short %d\n", odp->hint );
output( "\t%s \"%s\"\n", get_asm_string_keyword(), name );
}