mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-21 20:40:05 +00:00
003a27e819
The address of the stack canary is stored in a per-thread variable, which means that we must ensure that the TLS area is intialized before calling any -fstack-protector'ed functions. For dynamically linked applications, we ensure this (in a later patch) by disabling -fstack-protector for the whole dynamic linker, but for static applications, the AT_ENTRY address is called directly by the kernel, so we must deal with the problem differently. In static appliations, __libc_setup_tls performs the TCB setup and TLS initialization, so this commit arranges for it to be called early and unconditionally. The call (and the stack guard initialization) is before the DL_SYSDEP_OSCHECK hook, which if set will probably call functions which are stack-protected (it does on Linux and NaCL too). We also move apply_irel up, so that we can still safely call functions that require ifuncs while in __libc_setup_tls (though if stack-protection is enabled we still have to avoid calling functions that are not stack-protected at this stage). |
||
---|---|---|
.. | ||
abi-note.S | ||
check_fds.c | ||
dso_handle.c | ||
elf-init.c | ||
errno-loc.c | ||
errno.c | ||
gmon-start.c | ||
init-first.c | ||
init.c | ||
libc-start.c | ||
libc-tls.c | ||
Makefile | ||
start.c | ||
sysdep.c | ||
version.c | ||
Versions |