Fix tls support for glibc 2.25
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Fri, 9 Mar 2018 20:48:04 +0000 (20:48 +0000)
committerAurelien Jarno <aurel32@debian.org>
Fri, 9 Mar 2018 20:48:04 +0000 (20:48 +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 605222fa3f97d6e4ce8db7a7681e73fdaaf19186..8e92cc0d989cef85a752f0097efc76195bc57f57 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 e0665fd5ebc8b5071f7ed9a1afb3226f9fc21667..4907d423075b57e64223fafe9e70ac1ae5a435ac 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();