diff options
Diffstat (limited to 'elf')
-rw-r--r-- | elf/dl-tls.c | 8 | ||||
-rw-r--r-- | elf/libc_early_init.c | 4 |
2 files changed, 11 insertions, 1 deletions
diff --git a/elf/dl-tls.c b/elf/dl-tls.c index fa03234610..ca13778ca9 100644 --- a/elf/dl-tls.c +++ b/elf/dl-tls.c @@ -31,7 +31,7 @@ /* Amount of excess space to allocate in the static TLS area to allow dynamic loading of modules defining IE-model TLS data. */ -#define TLS_STATIC_SURPLUS 64 + DL_NNS * 100 +#define TLS_STATIC_SURPLUS 64 + DL_NNS * 176 /* Out-of-memory handler. */ @@ -134,6 +134,12 @@ void _dl_determine_tlsoffset (void) { size_t max_align = TLS_TCB_ALIGN; + /* libc.so with rseq has TLS with 32-byte alignment. Since TLS is + initialized before audit modules are loaded and slotinfo + information is available, this is not taken into account below in + the audit case. */ + max_align = MAX (max_align, 32U); + size_t freetop = 0; size_t freebottom = 0; diff --git a/elf/libc_early_init.c b/elf/libc_early_init.c index e6c64fb526..f0fcf6448e 100644 --- a/elf/libc_early_init.c +++ b/elf/libc_early_init.c @@ -18,10 +18,14 @@ #include <ctype.h> #include <libc-early-init.h> +#include <rseq-internal.h> void __libc_early_init (_Bool initial) { /* Initialize ctype data. */ __ctype_init (); + /* Register rseq ABI to the kernel for the main program's libc. */ + if (initial) + rseq_register_current_thread (); } |