From e9a38ed2fa61fd264a80f24ceb35f39b0ac6463d Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Fri, 9 Jun 2023 03:51:32 +0300 Subject: [PATCH] rtld: fix allocate_module_tls() variant I fallback to static allocation Submitted by: Joerg Sonnenberger Fixes: 91880e07f605edb90339685bc934699a4344de3bESC MFC after: 1 week --- libexec/rtld-elf/rtld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 72a128ccbb8..173dcd4e987 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -5465,7 +5465,7 @@ allocate_module_tls(int index) if (obj->tls_static) { #ifdef TLS_VARIANT_I - p = (char *)_tcb_get() + obj->tlsoffset; + p = (char *)_tcb_get() + obj->tlsoffset + TLS_TCB_SIZE; #else p = (char *)_tcb_get() - obj->tlsoffset; #endif