Fix tls support for glibc 2.25
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Tue, 4 Sep 2018 19:13:02 +0000 (20:13 +0100)
committerSamuel Thibault <sthibault@debian.org>
Tue, 4 Sep 2018 19:13:02 +0000 (20:13 +0100)
* 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 git2.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 c2ddaa453e43578fe534572d699c1a8b8866ac54..79746b7673d08a8ae773f6d8297d1cc96cf5a804 100644 (file)
@@ -189,7 +189,8 @@ init (int *data)
       assert (d->phdrsz % sizeof (ElfW(Phdr)) == 0);
     }
 
-  /* We need to setup TLS before starting the signal thread.  */
+  /* We need to setup TLS before starting the signal thread and set stack guard.  */
+  __libc_setup_tls ();
   extern void __pthread_initialize_minimal (void);
   if (__pthread_initialize_minimal != NULL)
     __pthread_initialize_minimal ();