1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-07 06:43:00 +03:00

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>
This commit is contained in:
Adhemerval Zanella
2022-06-07 11:11:03 -03:00
parent 5b41b2659d
commit baf2a265c7
7 changed files with 42 additions and 4 deletions

View File

@@ -25,3 +25,5 @@ char __libc_single_threaded;
#else
char __libc_single_threaded = 1;
#endif
libc_hidden_data_def_alias (__libc_single_threaded,
__libc_single_threaded_internal)