Commit 1f5c288b authored by Alexandre Julliard's avatar Alexandre Julliard

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
parent 4b59142f
...@@ -1851,6 +1851,7 @@ static void build_windows_import_lib( const char *lib_name, DLLSPEC *spec, struc ...@@ -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 ) ); output( "\tjmp *%s\n", asm_name( imp_name ) );
if (is_delay) if (is_delay)
{ {
output( "\n\t.section .text$1\n" );
output( ".L__wine_delay_import:\n" ); output( ".L__wine_delay_import:\n" );
output( "\tmov $%s,%%eax\n", asm_name( imp_name ) ); output( "\tmov $%s,%%eax\n", asm_name( imp_name ) );
output( "\tjmp %s\n", asm_name( delay_load ) ); 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 ...@@ -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 ) ); output( "\tjmp *%s(%%rip)\n", asm_name( imp_name ) );
if (is_delay) if (is_delay)
{ {
output( "\n\t.section .text$1\n" );
output( ".L__wine_delay_import:\n" ); output( ".L__wine_delay_import:\n" );
output( "\tlea %s(%%rip),%%rax\n", asm_name( imp_name ) ); output( "\tlea %s(%%rip),%%rax\n", asm_name( imp_name ) );
output( "\tjmp %s\n", asm_name( delay_load ) ); 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 ...@@ -1870,6 +1872,7 @@ static void build_windows_import_lib( const char *lib_name, DLLSPEC *spec, struc
output( "\tldr PC, [IP]\n" ); output( "\tldr PC, [IP]\n" );
if (is_delay) if (is_delay)
{ {
output( "\n\t.section .text$1\n" );
output( ".L__wine_delay_import:\n" ); output( ".L__wine_delay_import:\n" );
output( "\tldr IP, 1f\n" ); output( "\tldr IP, 1f\n" );
output( "\tldr IP, [IP]\n" ); output( "\tldr IP, [IP]\n" );
...@@ -1883,6 +1886,7 @@ static void build_windows_import_lib( const char *lib_name, DLLSPEC *spec, struc ...@@ -1883,6 +1886,7 @@ static void build_windows_import_lib( const char *lib_name, DLLSPEC *spec, struc
output( "\tbr x16\n" ); output( "\tbr x16\n" );
if (is_delay) if (is_delay)
{ {
output( "\n\t.section .text$1\n" );
output( ".L__wine_delay_import:\n" ); output( ".L__wine_delay_import:\n" );
output( "\tadrp x16, %s\n", arm64_page( asm_name( imp_name ) ) ); output( "\tadrp x16, %s\n", arm64_page( asm_name( imp_name ) ) );
output( "\tadd x16, x16, #%s\n", arm64_pageoff( asm_name( imp_name ) ) ); output( "\tadd x16, x16, #%s\n", arm64_pageoff( asm_name( imp_name ) ) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment