[PATCH v2] ntdll: Fix calling convention of image init function pointer array.

Torge Matthies openglfreak at googlemail.com
Fri Aug 13 19:35:56 CDT 2021


Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51596
Signed-off-by: Torge Matthies <openglfreak at googlemail.com>
---
Supersedes patch 211567.
v2: Don't add the attribute on non-x86 architectures.

 dlls/ntdll/loader.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 9f126249c01..45df5d4af4d 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -1345,7 +1345,11 @@ static void call_tls_callbacks( HMODULE module, UINT reason )
 static void init_builtin_dll( HMODULE module )
 {
     void *buffer[16];
+#if defined(__i386__) || defined(__x86_64__)
+    void (__attribute__ ((__sysv_abi__)) **funcs)(int, char **, char **) = (void *)buffer;
+#else
     void (**funcs)(int, char **, char **) = (void *)buffer;
+#endif
     SIZE_T i, size;
     NTSTATUS status;
 
-- 
2.32.0




More information about the wine-devel mailing list