]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Use TLS initial-exec model for __libc_tsd_CTYPE_* thread variables [BZ #33234]
authorJens Remus <jremus@linux.ibm.com>
Fri, 25 Jul 2025 13:40:03 +0000 (15:40 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Thu, 14 Aug 2025 10:39:11 +0000 (12:39 +0200)
Commit 10a66a8e421b ("Remove <libc-tsd.h>") removed the TLS initial-exec
(IE) model attribute from the __libc_tsd_CTYPE_* thread variable declarations
and definitions.  Commit a894f04d8776 ("Optimize __libc_tsd_* thread
variable access") restored it on declarations.

Restore the TLS initial-exec model attribute on __libc_tsd_CTYPE_* thread
variable definitions.

This resolves test tst-locale1 failure on s390 32-bit, when using a
GNU linker without the fix from GNU binutils commit aefebe82dc89
("IBM zSystems: Fix offset relative to static TLS").

Reviewed-by: Florian Weimer <fweimer@redhat.com>
(cherry picked from commit e5363e6f460c2d58809bf10fc96d70fd1ef8b5b2)

NEWS
ctype/ctype-info.c

diff --git a/NEWS b/NEWS
index 2915312d26d7810cf58f646544e0add25f9403e4..ff361d6ff92557c905259421aeaf84fd93839eca 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -105,6 +105,7 @@ The following bugs are resolved with this release:
   [32987] elf: Fix subprocess status handling for tst-dlopen-sgid
   [33185] Fix double-free after allocation failure in regcomp
   [32483] ctype macros segfault in multithreaded programs with multiple libc.so
+  [33234] Use TLS initial-exec model for __libc_tsd_CTYPE_* thread variables
 \f
 Version 2.39
 
index 621bd4239c8b4c2173cc1f0f3b71a6b5705ac9ea..b6cdf7eb667a7118276cc4eb2cc8f015a86946ca 100644 (file)
    __ctype_init before user code runs, but this does not happen for
    threads in secondary namespaces.  With the initializers, secondary
    namespaces at least get locale data from the C locale.  */
-__thread const uint16_t * __libc_tsd_CTYPE_B
+__thread const uint16_t * __libc_tsd_CTYPE_B attribute_tls_model_ie
   = (const uint16_t *) _nl_C_LC_CTYPE_class + 128;
-__thread const int32_t * __libc_tsd_CTYPE_TOLOWER
+__thread const int32_t * __libc_tsd_CTYPE_TOLOWER attribute_tls_model_ie
   = (const int32_t *) _nl_C_LC_CTYPE_tolower + 128;
-__thread const int32_t * __libc_tsd_CTYPE_TOUPPER
+__thread const int32_t * __libc_tsd_CTYPE_TOUPPER attribute_tls_model_ie
   = (const int32_t *) _nl_C_LC_CTYPE_toupper + 128;