[Bug target/80881] Implement Windows native TLS
ebotcazou at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Dec 4 11:50:11 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80881
--- Comment #109 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> When compiling with `-fdata-sections`, TLS template data can be placed into
> sections like
>
> 12 .tls$_ZSt11__once_call 00000008 0000000000000000 DATA
>
> which causes them to be sorted after `.tls$ZZZ`. The module which contains
> such data will be granted a TLS memory block of a wrong size, and is likely
> to result in heap corruption.
Yes, we ran into the problem yesterday, which results in the miscompilation of
the libstdc++. The patch to be attached is sufficient to fix it.
More information about the Gcc-bugs
mailing list