glibc/csu
Nick Alcock 003a27e819 Initialize the stack guard earlier when linking statically [BZ #7065]
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).
2016-12-26 10:08:34 +01:00
..
abi-note.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
check_fds.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dso_handle.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
elf-init.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
errno-loc.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
errno.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
gmon-start.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
init-first.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
init.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
libc-start.c Initialize the stack guard earlier when linking statically [BZ #7065] 2016-12-26 10:08:34 +01:00
libc-tls.c Initialize the stack guard earlier when linking statically [BZ #7065] 2016-12-26 10:08:34 +01:00
Makefile Move all tests out of the csu subdirectory 2016-12-21 11:52:19 +01:00
start.c More fallout from supporting only ELF 2012-01-08 00:45:01 -05:00
sysdep.c Moved to csu/errno-loc.c. 2005-12-14 15:06:39 +00:00
version.c Update copyright dates not handled by scripts/update-copyrights. 2016-01-04 16:26:30 +00:00
Versions Remove unused %include lines from Versions files. 2014-02-22 00:58:54 -08:00