From baf2a265c71113a91f6971313ef191be9e77ef6a Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Tue, 7 Jun 2022 11:11:03 -0300 Subject: 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 --- elf/libc_early_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'elf') diff --git a/elf/libc_early_init.c b/elf/libc_early_init.c index 3c4a19cf6b..affc46fefc 100644 --- a/elf/libc_early_init.c +++ b/elf/libc_early_init.c @@ -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 (); -- cgit 1.4.1