crt: Mark _tls_used as used for LTO 02b4df13b1aac0dba0a35e87f1a536594fd35edd added attribute used to _CRTALLOC, applying it automatically on most such special variables that need to be retained during LTO. _tls_used is also such a variable, but it's not located in any special section; thus apply the attribute directly. Signed-off-by: Martin Storsjö <martin@martin.st>
diff --git a/mingw-w64-crt/crt/tlssup.c b/mingw-w64-crt/crt/tlssup.c index 47beb27..1b9d7b4 100644 --- a/mingw-w64-crt/crt/tlssup.c +++ b/mingw-w64-crt/crt/tlssup.c
@@ -44,6 +44,7 @@ _CRTALLOC(".CRT$XLA") PIMAGE_TLS_CALLBACK __xl_a = 0; _CRTALLOC(".CRT$XLZ") PIMAGE_TLS_CALLBACK __xl_z = 0; +__attribute__((used)) const IMAGE_TLS_DIRECTORY _tls_used = { (ULONG_PTR) &_tls_start, (ULONG_PTR) &_tls_end, (ULONG_PTR) &_tls_index, (ULONG_PTR) (&__xl_a+1),