From: Samuel Thibault Date: Sat, 16 Dec 2017 14:37:43 +0000 (+0000) Subject: Fix tls support for glibc 2.25 X-Git-Tag: archive/raspbian/2.25-5+rpi1^2~75 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=eb25d4204ce081f581ae3676bb995cb43f0b0242;p=glibc.git Fix tls support for glibc 2.25 * csu/libc-start.c (LIBC_START_MAIN) [__GNU__]: Do not call __libc_setup_tls. * sysdeps/mach/hurd/i386/init-first.c (init): Call __libc_setup_tls. Signed-off-by: Samuel Thibault Gbp-Pq: Topic hurd-i386 Gbp-Pq: Name tg2.25-tls.diff --- diff --git a/csu/libc-start.c b/csu/libc-start.c index 9a56dcbba..d60db2996 100644 --- a/csu/libc-start.c +++ b/csu/libc-start.c @@ -185,8 +185,10 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL), /* Perform IREL{,A} relocations. */ apply_irel (); +#ifndef __GNU__ /* The stack guard goes into the TCB, so initialize it early. */ __libc_setup_tls (); +#endif /* Set up the stack checker's canary. */ uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard (_dl_random); diff --git a/sysdeps/mach/hurd/i386/init-first.c b/sysdeps/mach/hurd/i386/init-first.c index b649459c1..8ede962d5 100644 --- a/sysdeps/mach/hurd/i386/init-first.c +++ b/sysdeps/mach/hurd/i386/init-first.c @@ -197,7 +197,8 @@ init (int *data) assert (d->phdrsz % sizeof (ElfW(Phdr)) == 0); } - /* We need to setup TLS before starting sigthread */ + /* We need to setup TLS before starting sigthread and set stack guard. */ + __libc_setup_tls (); extern void __pthread_initialize_minimal(void); if (__pthread_initialize_minimal != NULL) __pthread_initialize_minimal();