https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80881
--- Comment #117 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Eric Botcazou <[email protected]>: https://gcc.gnu.org/g:3777a0b41f9fdcbb5fde4bdfce06031805cebc33 commit r16-5965-g3777a0b41f9fdcbb5fde4bdfce06031805cebc33 Author: Eric Botcazou <[email protected]> Date: Mon Dec 8 17:47:56 2025 +0100 MinGW: Fix native TLS bug with -fdata-sections The problem comes from a quirk of the GNU PE-COFF linker, which wants to make sure that .tls$ZZZ is laid out last among the TLS sections, but first globs all .tls$* sections together. The solution matches Clang's output. gcc/ PR target/80881 * config/mingw/winnt.cc (mingw_pe_unique_section): Put two dollar signs for TLS sections after the prefix. (mingw_pe_asm_named_section): Deal with all TLS sections uniformly. gcc/testsuite/ * gcc.dg/tls/data-sections-1.c: New test.
