1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +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

@@ -38,7 +38,7 @@ __libc_early_init (_Bool initial)
__libc_single_threaded = initial;
#ifdef SHARED
__libc_initial = initial;
__libc_single_threaded_internal = __libc_initial = initial;
#endif
__pthread_early_init ();