https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113081
--- Comment #2 from Iain Buclaw <ibuclaw at gdcproject dot org> --- It could be moved to drtstuff.o to avoid it being in the library, but unless there's an equivalent function available there'll be crashes caused by the GC free'ing live objects as it did not scan all TLS variables for the executing thread. If I recall correctly, this trick is not guaranteed to work (for a drtbegin.o and drtend.o object), as there really no control over where in the TLS section these variables will land. ``` #ifdef DRT_BEGIN _Thread_local __SIZE_TYPE__ __tls_start = 3; #endif #ifdef DRT_END _Thread_local __SIZE_TYPE__ __tls_end; #endif ```