]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
elf: Only define _dl_tls_allocate_active for SHARED
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 17 Oct 2025 19:13:15 +0000 (16:13 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 20 Oct 2025 14:33:54 +0000 (11:33 -0300)
clang issues:

dl-tls.c:108:1: error: unused function '_dl_tls_allocate_active' [-Werror,-Wunused-function]
  108 | _dl_tls_allocate_active (void)
      | ^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Reviewed-by: Sam James <sam@gentoo.org>
elf/dl-tls.c

index a083a829330af123f4a40d60f913a5f5729fca7d..aacd80cbe51cb940e3023506c8f2857f9c6b2203 100644 (file)
@@ -103,11 +103,13 @@ _dl_tls_allocate_end (void)
   atomic_fetch_add_relaxed (&_dl_tls_threads_in_update, -1);
 }
 
+#ifdef SHARED
 static inline bool
 _dl_tls_allocate_active (void)
 {
   return atomic_load_relaxed (&_dl_tls_threads_in_update) > 0;
 }
+#endif
 
 /* Compute the static TLS surplus based on the namespace count and the
    TLS space that can be used for optimizations.  */