summaryrefslogtreecommitdiff
path: root/app-emulation/wine-vanilla/files/wine-vanilla-10.0-binutils2.44.patch
diff options
context:
space:
mode:
Diffstat (limited to 'app-emulation/wine-vanilla/files/wine-vanilla-10.0-binutils2.44.patch')
-rw-r--r--app-emulation/wine-vanilla/files/wine-vanilla-10.0-binutils2.44.patch105
1 files changed, 105 insertions, 0 deletions
diff --git a/app-emulation/wine-vanilla/files/wine-vanilla-10.0-binutils2.44.patch b/app-emulation/wine-vanilla/files/wine-vanilla-10.0-binutils2.44.patch
new file mode 100644
index 000000000000..d7e30393569e
--- /dev/null
+++ b/app-emulation/wine-vanilla/files/wine-vanilla-10.0-binutils2.44.patch
@@ -0,0 +1,105 @@
+Note that this is only an issue when using mingw (PE) binutils-2.44,
+host (ELF) binutils-2.44 has no impact on this and, before this patch,
+using 2.44 could only happen with off-by-default USE=crossdev-mingw.
+
+https://bugs.winehq.org/show_bug.cgi?id=57819
+https://sourceware.org/PR32675
+https://gitlab.winehq.org/wine/wine/-/merge_requests/7328
+--- a/dlls/ntdll/loader.c
++++ b/dlls/ntdll/loader.c
+@@ -3750,5 +3750,5 @@
+ NTSTATUS nts;
+ FARPROC fp;
+- DWORD id;
++ INT_PTR id;
+
+ TRACE( "(%p, %p, %p, %p, %p, 0x%08lx)\n", base, desc, dllhook, syshook, addr, flags );
+--- a/tools/winebuild/import.c
++++ b/tools/winebuild/import.c
+@@ -1332,4 +1332,14 @@
+ }
+
++static void output_import_section( int index, int is_delay )
++{
++ if (!is_delay)
++ output( "\n\t.section .idata$%d\n", index );
++ else if (index == 5)
++ output( "\n\t.section .data$didat%d\n", index );
++ else
++ output( "\n\t.section .rdata$didat%d\n", index );
++}
++
+ /* create a Windows-style import library */
+ static void build_windows_import_lib( const char *lib_name, DLLSPEC *spec, struct strarray files )
+@@ -1455,18 +1465,18 @@
+ output( "\t.long 0\n" ); /* TimeDateStamp */
+
+- output( "\n\t.section .idata$5\n" );
++ output_import_section( 5, is_delay );
+ output( "\t%s 0\n", get_asm_ptr_keyword() ); /* FirstThunk tail */
+ output( ".L__wine_import_addrs:\n" );
+
+- output( "\n\t.section .idata$4\n" );
++ output_import_section( 4, is_delay );
+ output( "\t%s 0\n", get_asm_ptr_keyword() ); /* OriginalFirstThunk tail */
+ output( ".L__wine_import_names:\n" );
+
+ /* required to avoid internal linker errors with some binutils versions */
+- output( "\n\t.section .idata$2\n" );
++ output_import_section( 2, is_delay );
+ }
+ else
+ {
+- output( "\n\t.section .idata$2\n" );
++ output_import_section( 2, is_delay );
+ output( "%s\n", asm_globl( import_desc ) );
+ output_rva( ".L__wine_import_names" ); /* OriginalFirstThunk */
+@@ -1476,8 +1486,8 @@
+ output_rva( ".L__wine_import_addrs" ); /* FirstThunk */
+
+- output( "\n\t.section .idata$4\n" );
++ output_import_section( 4, is_delay );
+ output( ".L__wine_import_names:\n" ); /* OriginalFirstThunk head */
+
+- output( "\n\t.section .idata$5\n" );
++ output_import_section( 5, is_delay );
+ output( ".L__wine_import_addrs:\n" ); /* FirstThunk head */
+ }
+@@ -1490,9 +1500,9 @@
+ new_output_as_file();
+
+- output( "\n\t.section .idata$4\n" );
++ output_import_section( 4, is_delay );
+ output( "\t%s 0\n", get_asm_ptr_keyword() ); /* OriginalFirstThunk tail */
+- output( "\n\t.section .idata$5\n" );
++ output_import_section( 5, is_delay );
+ output( "\t%s 0\n", get_asm_ptr_keyword() ); /* FirstThunk tail */
+- output( "\n\t.section .idata$7\n" );
++ output_import_section( 7, is_delay );
+ output( "%s\n", asm_globl( import_name ) );
+ output( "\t%s \"%s\"\n", get_asm_string_keyword(), spec->file_name );
+@@ -1585,8 +1595,8 @@
+ }
+
+- output( "\n\t.section .idata$4\n" );
++ output_import_section( 4, is_delay );
+ output_thunk_rva( by_name ? -1 : odp->ordinal, ".L__wine_import_name" );
+
+- output( "\n\t.section .idata$5\n" );
++ output_import_section( 5, is_delay );
+ output( "%s\n", asm_globl( imp_name ) );
+ if (is_delay)
+@@ -1597,5 +1607,5 @@
+ if (by_name)
+ {
+- output( "\n\t.section .idata$6\n" );
++ output_import_section( 6, is_delay );
+ output( ".L__wine_import_name:\n" );
+ output( "\t.short %d\n", odp->hint );
+@@ -1604,5 +1614,5 @@
+
+ /* reference head object to always pull its sections */
+- output( "\n\t.section .idata$7\n" );
++ output_import_section( 7, is_delay );
+ output_rva( "%s", asm_name( import_desc ) );
+