Fix tls support for glibc 2.25
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 14 Jan 2018 10:24:48 +0000 (10:24 +0000)
committerAurelien Jarno <aurel32@debian.org>
Sun, 14 Jan 2018 10:24:48 +0000 (10:24 +0000)
* 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 <samuel.thibault@ens-lyon.org>
Gbp-Pq: Topic hurd-i386
Gbp-Pq: Name tg2.25-tls.diff

csu/libc-start.c
sysdeps/mach/hurd/i386/init-first.c

index 672061718877c7d42a63fa460fa8b4a6e9ff7936..561c63df0bc6ef589c40ed452852b7cbfb463627 100644 (file)
@@ -193,8 +193,10 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
   /* Perform IREL{,A} relocations.  */
   ARCH_SETUP_IREL ();
 
+#ifndef __GNU__
   /* The stack guard goes into the TCB, so initialize it early.  */
   __libc_setup_tls ();
+#endif
 
   /* In some architectures, IREL{,A} relocations happen after TLS setup in
      order to let IFUNC resolvers benefit from TCB information, e.g. powerpc's
index 8753b543f97c76bbe5acb588202a07ae5e8d8123..01299af7011dcf73dab6bf0c9a1e20f2376f1c94 100644 (file)
@@ -189,7 +189,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();