diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2022-06-07 11:11:03 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2022-06-24 17:45:58 -0300 |
commit | baf2a265c71113a91f6971313ef191be9e77ef6a (patch) | |
tree | ad894e8766707e8c10e98b6e4c857ab315fa0276 /include/sys | |
parent | 5b41b2659d35b72636ab50a28d6815cad9c22a66 (diff) | |
download | glibc-baf2a265c71113a91f6971313ef191be9e77ef6a.zip glibc-baf2a265c71113a91f6971313ef191be9e77ef6a.tar.gz glibc-baf2a265c71113a91f6971313ef191be9e77ef6a.tar.bz2 |
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 'include/sys')
-rw-r--r-- | include/sys/single_threaded.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/sys/single_threaded.h b/include/sys/single_threaded.h index 18f6972..2015742 100644 --- a/include/sys/single_threaded.h +++ b/include/sys/single_threaded.h @@ -1 +1,12 @@ #include <misc/sys/single_threaded.h> + +#ifndef _ISOMAC + +libc_hidden_proto_alias (__libc_single_threaded, + __libc_single_threaded_internal); + +#if !defined SHARED || !IS_IN(libc) +# define __libc_single_threaded_internal __libc_single_threaded +#endif + +#endif |