Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 2003d1abfa0c20ee77815f0da33e2c1c > files > 136

glibc-2.5-49.el5_5.5.src.rpm

2007-06-18  Jakub Jelinek  <jakub@redhat.com>

	* elf/rtld.c (dl_main): Don't call init_tls more than once.

--- libc/elf/rtld.c	12 Feb 2007 15:17:21 -0000	1.370
+++ libc/elf/rtld.c	18 Jun 2007 20:50:34 -0000	1.371
@@ -1400,6 +1400,12 @@ of this helper program; chances are you 
       /* Iterate over all entries in the list.  The order is important.  */
       struct audit_ifaces *last_audit = NULL;
       struct audit_list *al = audit_list->next;
+
+#ifdef USE_TLS
+      /* Since we start using the auditing DSOs right away we need to
+	 initialize the data structures now.  */
+      tcbp = init_tls ();
+#endif
       do
 	{
 	  int tls_idx = GL(dl_tls_max_dtv_idx);
@@ -1409,11 +1414,7 @@ of this helper program; chances are you 
 	     always allocate the static block, we never defer it even if
 	     no DF_STATIC_TLS bit is set.  The reason is that we know
 	     glibc will use the static model.  */
-
-	  /* Since we start using the auditing DSOs right away we need to
-	     initialize the data structures now.  */
-	  tcbp = init_tls ();
 #endif
 	  struct dlmopen_args dlmargs;
 	  dlmargs.fname = al->name;
 	  dlmargs.map = NULL;