Evgeniy Stepanov
1a78fbb5c8
Initialize TLS before any application code is run.
Since e19d702b8e33, dlsym and friends use recursive mutexes that require the current thread id, which is not available before the libc constructor. This prevents us from using dlsym() in .preinit_array. This change moves TLS initialization from libc constructor to the earliest possible point - immediately after linker itself is relocated. As a result, pthread_internal_t for the initial thread is available from the start. As a bonus, values stored in TLS in .preinit_array are not lost when libc is initialized. Change-Id: Iee5a710ee000173bff63e924adeb4a4c600c1e2d
Description
No description provided
Languages
C
68.1%
Assembly
16.2%
C++
13.4%
Makefile
1.1%
Python
0.9%
Other
0.2%