Fix tls support for glibc 2.25
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Sat, 2 Dec 2017 10:07:17 +0000 (10:07 +0000)
committerAurelien Jarno <aurel32@debian.org>
Sat, 2 Dec 2017 10:07:17 +0000 (10:07 +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 9a56dcbbaeb7ef85c495b4df9ab1d0b13454c043..d60db29967db2bb95d252aa956a9dce76dc5e7e2 100644 (file)
@@ -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);
index b649459c1fa3dfd7172663839e62b714a9009bbf..8ede962d51a05022e20c4cab5d550421a50adb00 100644 (file)
@@ -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();