Module: wine Branch: master Commit: 1f5c288b4f4c5fc9faadab5e9bbf24cc9e32e64e URL: https://gitlab.winehq.org/wine/wine/-/commit/1f5c288b4f4c5fc9faadab5e9bbf24c...
Author: Alexandre Julliard julliard@winehq.org Date: Wed Dec 7 10:05:49 2022 +0100
winebuild: Put the delay import thunk in a separate section.
To work around a binutils bug, cf. https://sourceware.org/bugzilla/show_bug.cgi?id=14339
---
tools/winebuild/import.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index dfda228c4ec..ee3c310546b 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -1851,6 +1851,7 @@ static void build_windows_import_lib( const char *lib_name, DLLSPEC *spec, struc output( "\tjmp *%s\n", asm_name( imp_name ) ); if (is_delay) { + output( "\n\t.section .text$1\n" ); output( ".L__wine_delay_import:\n" ); output( "\tmov $%s,%%eax\n", asm_name( imp_name ) ); output( "\tjmp %s\n", asm_name( delay_load ) ); @@ -1860,6 +1861,7 @@ static void build_windows_import_lib( const char *lib_name, DLLSPEC *spec, struc output( "\tjmp *%s(%%rip)\n", asm_name( imp_name ) ); if (is_delay) { + output( "\n\t.section .text$1\n" ); output( ".L__wine_delay_import:\n" ); output( "\tlea %s(%%rip),%%rax\n", asm_name( imp_name ) ); output( "\tjmp %s\n", asm_name( delay_load ) ); @@ -1870,6 +1872,7 @@ static void build_windows_import_lib( const char *lib_name, DLLSPEC *spec, struc output( "\tldr PC, [IP]\n" ); if (is_delay) { + output( "\n\t.section .text$1\n" ); output( ".L__wine_delay_import:\n" ); output( "\tldr IP, 1f\n" ); output( "\tldr IP, [IP]\n" ); @@ -1883,6 +1886,7 @@ static void build_windows_import_lib( const char *lib_name, DLLSPEC *spec, struc output( "\tbr x16\n" ); if (is_delay) { + output( "\n\t.section .text$1\n" ); output( ".L__wine_delay_import:\n" ); output( "\tadrp x16, %s\n", arm64_page( asm_name( imp_name ) ) ); output( "\tadd x16, x16, #%s\n", arm64_pageoff( asm_name( imp_name ) ) );