about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-06-07 11:11:03 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-06-24 17:45:58 -0300
commitbaf2a265c71113a91f6971313ef191be9e77ef6a (patch)
treead894e8766707e8c10e98b6e4c857ab315fa0276 /sysdeps
parent5b41b2659d35b72636ab50a28d6815cad9c22a66 (diff)
downloadglibc-baf2a265c71113a91f6971313ef191be9e77ef6a.tar.gz
glibc-baf2a265c71113a91f6971313ef191be9e77ef6a.tar.xz
glibc-baf2a265c71113a91f6971313ef191be9e77ef6a.zip
misc: Optimize internal usage of __libc_single_threaded
By adding an internal alias to avoid the GOT indirection.
On some architecture, __libc_single_thread may be accessed through
copy relocations and thus it requires to update also the copies
default copy.

This is done by adding a new internal macro,
libc_hidden_data_{proto,def}, which has an addition argument that
specifies the alias name (instead of default __GI_ one).

Checked on x86_64-linux-gnu and i686-linux-gnu.

Reviewed-by: Fangrui Song <maskray@google.com>
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/nptl/setxid.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdeps/nptl/setxid.h b/sysdeps/nptl/setxid.h
index b821d6bc07..b87cad7b18 100644
--- a/sysdeps/nptl/setxid.h
+++ b/sysdeps/nptl/setxid.h
@@ -29,7 +29,7 @@
 #define INLINE_SETXID_SYSCALL(name, nr, args...) \
   ({									\
     int __result;							\
-    if (!__libc_single_threaded)					\
+    if (!__libc_single_threaded_internal)				\
       {									\
 	struct xid_command __cmd;					\
 	__cmd.syscall_no = __NR_##name;					\