Upstream commit: fffc2df8a3e2c8cda2991063d23086360268b777 - i386: Provide GLIBC_ABI_GNU_TLS symbol version [BZ #33221] - i386: Update ___tls_get_addr to preserve vector registers - Extend struct r_debug to support multiple namespaces (RHEL-101985) - Fix a potential crash in the dynamic loader when processing specific symbol versions (RHEL-109683) - Signal la_objopen for ld.so with dlmopen (RHEL-109693) - Switch to main malloc after final ld.so self-relocation (RHEL-109703) - Prevent ld.so from asserting and crashing during audited library loads (RHEL-109702) - x86-64: Provide GLIBC_ABI_DT_X86_64_PLT symbol version (RHEL-109621) - x86-64, i386: Provide GLIBC_ABI_GNU2_TLS symbol version (RHEL-109625) - Ensure fallback initialization of ctype TLS data pointers to fix segfaults in programs using dlmopen or auditors (RHEL-72018) - Handle load segment gaps in _dl_find_object (RHEL-104854) - AArch64: Improve codegen in SVE log1p - AArch64: Optimize inverse trig functions - AArch64: Avoid memset ifunc in cpu-features.c [BZ #33112] Resolves: RHEL-109536 Resolves: RHEL-72018 Resolves: RHEL-101985 Resolves: RHEL-104854 Resolves: RHEL-109621 Resolves: RHEL-109625 Resolves: RHEL-109683 Resolves: RHEL-109693 Resolves: RHEL-109702 Resolves: RHEL-109703
62 lines
2.4 KiB
Diff
62 lines
2.4 KiB
Diff
commit fffc2df8a3e2c8cda2991063d23086360268b777
|
|
Author: Florian Weimer <fweimer@redhat.com>
|
|
Date: Fri May 16 19:53:09 2025 +0200
|
|
|
|
Optimize __libc_tsd_* thread variable access
|
|
|
|
These variables are not exported, and libc.so TLS is initial-exec
|
|
anyway. Declare these variables as hidden and use the initial-exec
|
|
TLS model.
|
|
|
|
Reviewed-by: Frédéric Bérat <fberat@redhat.com>
|
|
(cherry picked from commit a894f04d877653bea1639fc9a4adf73bd9347bf4)
|
|
|
|
diff --git a/include/ctype.h b/include/ctype.h
|
|
index ae078a63d355af61..a15e5b66781535d4 100644
|
|
--- a/include/ctype.h
|
|
+++ b/include/ctype.h
|
|
@@ -29,9 +29,12 @@ libc_hidden_proto (toupper)
|
|
# define CTYPE_EXTERN_INLINE extern inline
|
|
# endif
|
|
|
|
-extern __thread const uint16_t * __libc_tsd_CTYPE_B;
|
|
-extern __thread const int32_t * __libc_tsd_CTYPE_TOUPPER;
|
|
-extern __thread const int32_t * __libc_tsd_CTYPE_TOLOWER;
|
|
+extern __thread const uint16_t * __libc_tsd_CTYPE_B
|
|
+ attribute_hidden attribute_tls_model_ie;
|
|
+extern __thread const int32_t * __libc_tsd_CTYPE_TOUPPER
|
|
+ attribute_hidden attribute_tls_model_ie;
|
|
+extern __thread const int32_t * __libc_tsd_CTYPE_TOLOWER
|
|
+ attribute_hidden attribute_tls_model_ie;
|
|
|
|
|
|
CTYPE_EXTERN_INLINE const uint16_t ** __attribute__ ((const))
|
|
diff --git a/include/rpc/rpc.h b/include/rpc/rpc.h
|
|
index 936ea3cebb8101e1..ba967833ad8d8ac3 100644
|
|
--- a/include/rpc/rpc.h
|
|
+++ b/include/rpc/rpc.h
|
|
@@ -45,7 +45,8 @@ extern void __rpc_thread_key_cleanup (void) attribute_hidden;
|
|
|
|
extern void __rpc_thread_destroy (void) attribute_hidden;
|
|
|
|
-extern __thread struct rpc_thread_variables *__libc_tsd_RPC_VARS;
|
|
+extern __thread struct rpc_thread_variables *__libc_tsd_RPC_VARS
|
|
+ attribute_hidden attribute_tls_model_ie;
|
|
|
|
#define RPC_THREAD_VARIABLE(x) (__rpc_thread_variables()->x)
|
|
|
|
diff --git a/locale/localeinfo.h b/locale/localeinfo.h
|
|
index bc8e92e4dca80d62..c3249d371537ad7d 100644
|
|
--- a/locale/localeinfo.h
|
|
+++ b/locale/localeinfo.h
|
|
@@ -237,7 +237,8 @@ extern struct __locale_struct _nl_global_locale attribute_hidden;
|
|
/* This fetches the thread-local locale_t pointer, either one set with
|
|
uselocale or &_nl_global_locale. */
|
|
#define _NL_CURRENT_LOCALE __libc_tsd_LOCALE
|
|
-extern __thread locale_t __libc_tsd_LOCALE;
|
|
+extern __thread locale_t __libc_tsd_LOCALE
|
|
+ attribute_hidden attribute_tls_model_ie;
|
|
|
|
/* For static linking it is desireable to avoid always linking in the code
|
|
and data for every category when we can tell at link time that they are
|