Signed-off-by: Antonin Décimo <[email protected]>
---
mingw-w64-libraries/winpthreads/src/thread.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/mingw-w64-libraries/winpthreads/src/thread.c
b/mingw-w64-libraries/winpthreads/src/thread.c
index 7c5e75f91..16b13b07c 100644
--- a/mingw-w64-libraries/winpthreads/src/thread.c
+++ b/mingw-w64-libraries/winpthreads/src/thread.c
@@ -508,11 +508,25 @@ __dyn_tls_pthread (HANDLE hDllHandle, DWORD dwReason,
LPVOID lpreserved)
/* TLS-runtime section variable. */
#ifdef _MSC_VER
-#pragma section(".CRT$XLF", shared)
+# ifdef _WIN64
+/* .CRT section is merged with .rdata on x64 so it must be constant data. */
+# pragma const_seg(push, old_seg)
+/* Use a typical possible name in the .CRT$XL? list of segments. */
+# pragma const_seg(".CRT$XLF")
+const
+# else
+# pragma data_seg(push, old_seg)
+/* Use a typical possible name in the .CRT$XL? list of segments. */
+# pragma data_seg(".CRT$XLF")
+# endif
#endif
PIMAGE_TLS_CALLBACK WINPTHREADS_ATTRIBUTE((WINPTHREADS_SECTION(".CRT$XLF")))
__xl_f = __dyn_tls_pthread;
#ifdef _MSC_VER
-#pragma data_seg()
+# ifdef _WIN64
+# pragma const_seg(pop, old_seg)
+# else
+# pragma data_seg(pop, old_seg)
+# endif
#endif
#ifdef WINPTHREAD_DBG
--
2.43.0
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public