summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-08-21 00:17:09 +0000
committerUlrich Drepper <drepper@redhat.com>2002-08-21 00:17:09 +0000
commit9d69bd2492a229db2c165b56afb4e8822abe5b62 (patch)
treed3bef83d65c990e7be5ac94095389f61c64757a2
parent845f758a393a75039e20743965a4392688fbe4b1 (diff)
downloadglibc-9d69bd2492a229db2c165b56afb4e8822abe5b62.tar.gz
glibc-9d69bd2492a229db2c165b56afb4e8822abe5b62.tar.xz
glibc-9d69bd2492a229db2c165b56afb4e8822abe5b62.zip
Update.
2002-08-20  Ulrich Drepper  <drepper@redhat.com>

	* elf/rtld.c (_dl_start): Pass zero to TLS_INIT_TP.  Set
	bootstrap_map.l_tls_tp_initialized to 1 if TLS_INIT_TP was called.
	(_dl_start_final): Copy l_tls_tp_initialized to GL(dl_rtld_map).
	(dl_main): If HAVE___THREAD is not defined pass l_tls_tp_initialized
	to TL_INIT_TP.  Otherwise pass 1.
	* include/link.h (struct link_map): Add l_tls_tp_initialized.
	* sysdeps/generic/libc-tls.c (__libc_setup_tls): Pass 0 to TL_INIT_TP.

2002-08-20  Brian Youmans  <3diff@gnu.org>
	* manual/contrib.texi: Removed licenses, added acknowledgements
	for contributions by Intel, IBM, Craig Metz.
	* LICENSES: New file, contains the text of all non-FSF licenses in the
	* sysdeps/mach/hurd/net/if_ppp.h: Replaced CMU license with a
	new one modelled on the modern BSD license, per recent letter
	of permission from CMU.
	* sysdeps/unix/sysv/linux/net/if_ppp.h: Likewise.

	* sysdeps/ieee754/dbl-64/MathLib.h: Changed the copyright holder
	from IBM to FSF, per the recent Software Letter.  Changed the
	distribution terms from GPL to LGPL.

	* sysdeps/ieee754/dbl-64/asincos.tbl: Added FSF copyright and
	copying permission notice (Lesser GPL), per recent IBM Software Letter.
	* sysdeps/ieee754/dbl-64/powtwo.tbl: Likewise.
	* sysdeps/ieee754/dbl-64/root.tbl: Likewise.
	* sysdeps/ieee754/dbl-64/sincos.tbl: Likewise.
	* sysdeps/ieee754/dbl-64/uatan.tbl: Likewise.
	* sysdeps/ieee754/dbl-64/uexp.tbl: Likewise.
	* sysdeps/ieee754/dbl-64/ulog.tbl: Likewise.
	* sysdeps/ieee754/dbl-64/upow.tbl: Likewise.
	* sysdeps/ieee754/dbl-64/utan.tbl: Likewise.

	* sysdeps/ieee754/dbl-64/atnat.h: Changed the copyright holder
	* sysdeps/ieee754/dbl-64/atnat2.h: Likewise.
	* sysdeps/ieee754/dbl-64/branred.h: Likewise.
	* sysdeps/ieee754/dbl-64/dla.h: Likewise.
	* sysdeps/ieee754/dbl-64/doasin.h: Likewise.
	* sysdeps/ieee754/dbl-64/dosincos.h: Likewise.
	* sysdeps/ieee754/dbl-64/mpa.h: Likewise.
	* sysdeps/ieee754/dbl-64/mpa2.h: Likewise.
	* sysdeps/ieee754/dbl-64/mpatan.h: Likewise.
	* sysdeps/ieee754/dbl-64/mpexp.h: Likewise.
	* sysdeps/ieee754/dbl-64/mplog.h: Likewise.
	* sysdeps/ieee754/dbl-64/mpsqrt.h: Likewise.
	* sysdeps/ieee754/dbl-64/mydefs.h: Likewise.
	* sysdeps/ieee754/dbl-64/sincos32.h: Likewise.
	* sysdeps/ieee754/dbl-64/uasncs.h: Likewise.
	* sysdeps/ieee754/dbl-64/uexp.h: Likewise.
	* sysdeps/ieee754/dbl-64/ulog.h: Likewise.
	* sysdeps/ieee754/dbl-64/upow.h: Likewise.
	* sysdeps/ieee754/dbl-64/urem.h: Likewise.
	* sysdeps/ieee754/dbl-64/uroot.h: Likewise.
	* sysdeps/ieee754/dbl-64/usncs.h: Likewise.
	* sysdeps/ieee754/dbl-64/utan.h: Likewise.

	* sysdeps/ieee754/dbl-64/branred.c: Corrected the text of the copying
	* sysdeps/ieee754/dbl-64/doasin.c: Likewise.
	* sysdeps/ieee754/dbl-64/dosincos.c: Likewise.
	* sysdeps/ieee754/dbl-64/e_asin.c: Likewise.
	* sysdeps/ieee754/dbl-64/e_atan2.c: Likewise.
	* sysdeps/ieee754/dbl-64/e_exp.c: Likewise.
	* sysdeps/ieee754/dbl-64/e_log.c: Likewise.
	* sysdeps/ieee754/dbl-64/e_pow.c: Likewise.
	* sysdeps/ieee754/dbl-64/e_remainder.c: Likewise.
	* sysdeps/ieee754/dbl-64/e_sqrt.c: Likewise.
	* sysdeps/ieee754/dbl-64/halfulp.c: Likewise.
	* sysdeps/ieee754/dbl-64/mpa.c: Likewise.
	* sysdeps/ieee754/dbl-64/mpatan.c: Likewise.
	* sysdeps/ieee754/dbl-64/mpatan2.c: Likewise.
	* sysdeps/ieee754/dbl-64/mpexp.c: Likewise.
	* sysdeps/ieee754/dbl-64/mplog.c: Likewise.
	* sysdeps/ieee754/dbl-64/mpsqrt.c: Likewise.
	* sysdeps/ieee754/dbl-64/mptan.c: Likewise.
	* sysdeps/ieee754/dbl-64/s_atan.c: Likewise.
	* sysdeps/ieee754/dbl-64/s_sin.c: Likewise.
	* sysdeps/ieee754/dbl-64/s_tan.c: Likewise.
	* sysdeps/ieee754/dbl-64/sincos32.c: Likewise.
	* sysdeps/ieee754/dbl-64/slowexp.c: Likewise.
	* sysdeps/ieee754/dbl-64/slowpow.c:  Likewise.
-rw-r--r--ChangeLog152
-rw-r--r--elf/rtld.c18
-rw-r--r--include/link.h3
-rw-r--r--linuxthreads/ChangeLog7
-rw-r--r--linuxthreads/sysdeps/sh/tls.h2
-rw-r--r--sysdeps/generic/libc-tls.c4
6 files changed, 109 insertions, 77 deletions
diff --git a/ChangeLog b/ChangeLog
index 90d4f62100..49769e4b7b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2002-08-20  Ulrich Drepper  <drepper@redhat.com>
+
+	* elf/rtld.c (_dl_start): Pass zero to TLS_INIT_TP.  Set
+	bootstrap_map.l_tls_tp_initialized to 1 if TLS_INIT_TP was called.
+	(_dl_start_final): Copy l_tls_tp_initialized to GL(dl_rtld_map).
+	(dl_main): If HAVE___THREAD is not defined pass l_tls_tp_initialized
+	to TL_INIT_TP.  Otherwise pass 1.
+	* include/link.h (struct link_map): Add l_tls_tp_initialized.
+	* sysdeps/generic/libc-tls.c (__libc_setup_tls): Pass 0 to TL_INIT_TP.
+
 2002-08-15  Jakub Jelinek  <jakub@redhat.com>
 
 	* locale/programs/localedef.c (add_to_readlist): Error about
@@ -11,87 +21,87 @@
 	* locale/programs/locarchive.c (enlarge_archive): If quiet, don't
 	print any messages about enlarging archive.
 
-2002-08-20 Brian Youmans <3diff@gnu.org>
+2002-08-20  Brian Youmans  <3diff@gnu.org>
 
-        * manual/contrib.texi: Removed licenses, added acknowledgements
-        for contributions by Intel, IBM, Craig Metz.
-        * LICENSES: New file, contains the text of all non-FSF licenses in the
+	* manual/contrib.texi: Removed licenses, added acknowledgements
+	for contributions by Intel, IBM, Craig Metz.
+	* LICENSES: New file, contains the text of all non-FSF licenses in the
 	distribution that require putting the notice in the accompanying
 	documentation.
 	* README.template, README: Mention LICENSES.
 
-        * sysdeps/mach/hurd/net/if_ppp.h: Replaced CMU license with a
-        new one modelled on the modern BSD license, per recent letter
-        of permission from CMU.
-        * sysdeps/unix/sysv/linux/net/if_ppp.h: Likewise.
-
-        * sysdeps/ieee754/dbl-64/MathLib.h: Changed the copyright holder
-        from IBM to FSF, per the recent Software Letter.  Changed the
-        distribution terms from GPL to LGPL.
-
-        * sysdeps/ieee754/dbl-64/asincos.tbl: Added FSF copyright and
-        copying permission notice (Lesser GPL), per recent IBM Software Letter.
-        * sysdeps/ieee754/dbl-64/powtwo.tbl: Likewise.
-        * sysdeps/ieee754/dbl-64/root.tbl: Likewise.
-        * sysdeps/ieee754/dbl-64/sincos.tbl: Likewise.
-        * sysdeps/ieee754/dbl-64/uatan.tbl: Likewise.
-        * sysdeps/ieee754/dbl-64/uexp.tbl: Likewise.
-        * sysdeps/ieee754/dbl-64/ulog.tbl: Likewise.
-        * sysdeps/ieee754/dbl-64/upow.tbl: Likewise.
-        * sysdeps/ieee754/dbl-64/utan.tbl: Likewise.
-
-        * sysdeps/ieee754/dbl-64/atnat.h: Changed the copyright holder
+	* sysdeps/mach/hurd/net/if_ppp.h: Replaced CMU license with a
+	new one modelled on the modern BSD license, per recent letter
+	of permission from CMU.
+	* sysdeps/unix/sysv/linux/net/if_ppp.h: Likewise.
+
+	* sysdeps/ieee754/dbl-64/MathLib.h: Changed the copyright holder
+	from IBM to FSF, per the recent Software Letter.  Changed the
+	distribution terms from GPL to LGPL.
+
+	* sysdeps/ieee754/dbl-64/asincos.tbl: Added FSF copyright and
+	copying permission notice (Lesser GPL), per recent IBM Software Letter.
+	* sysdeps/ieee754/dbl-64/powtwo.tbl: Likewise.
+	* sysdeps/ieee754/dbl-64/root.tbl: Likewise.
+	* sysdeps/ieee754/dbl-64/sincos.tbl: Likewise.
+	* sysdeps/ieee754/dbl-64/uatan.tbl: Likewise.
+	* sysdeps/ieee754/dbl-64/uexp.tbl: Likewise.
+	* sysdeps/ieee754/dbl-64/ulog.tbl: Likewise.
+	* sysdeps/ieee754/dbl-64/upow.tbl: Likewise.
+	* sysdeps/ieee754/dbl-64/utan.tbl: Likewise.
+
+	* sysdeps/ieee754/dbl-64/atnat.h: Changed the copyright holder
 	from IBM to FSF, per the recent Software Letter.  Corrected the
 	text of the copying permission notice to say Lesser GPL instead
 	of GPL in warranty disclaimer paragraph.
-        * sysdeps/ieee754/dbl-64/atnat2.h: Likewise.
-        * sysdeps/ieee754/dbl-64/branred.h: Likewise.
-        * sysdeps/ieee754/dbl-64/dla.h: Likewise.
-        * sysdeps/ieee754/dbl-64/doasin.h: Likewise.
-        * sysdeps/ieee754/dbl-64/dosincos.h: Likewise.
-        * sysdeps/ieee754/dbl-64/mpa.h: Likewise.
-        * sysdeps/ieee754/dbl-64/mpa2.h: Likewise.
-        * sysdeps/ieee754/dbl-64/mpatan.h: Likewise.
-        * sysdeps/ieee754/dbl-64/mpexp.h: Likewise.
-        * sysdeps/ieee754/dbl-64/mplog.h: Likewise.
-        * sysdeps/ieee754/dbl-64/mpsqrt.h: Likewise.
-        * sysdeps/ieee754/dbl-64/mydefs.h: Likewise.
-        * sysdeps/ieee754/dbl-64/sincos32.h: Likewise.
-        * sysdeps/ieee754/dbl-64/uasncs.h: Likewise.
-        * sysdeps/ieee754/dbl-64/uexp.h: Likewise.
-        * sysdeps/ieee754/dbl-64/ulog.h: Likewise.
-        * sysdeps/ieee754/dbl-64/upow.h: Likewise.
-        * sysdeps/ieee754/dbl-64/urem.h: Likewise.
-        * sysdeps/ieee754/dbl-64/uroot.h: Likewise.
-        * sysdeps/ieee754/dbl-64/usncs.h: Likewise.
-        * sysdeps/ieee754/dbl-64/utan.h: Likewise.
-
-        * sysdeps/ieee754/dbl-64/branred.c: Corrected the text of the copying
+	* sysdeps/ieee754/dbl-64/atnat2.h: Likewise.
+	* sysdeps/ieee754/dbl-64/branred.h: Likewise.
+	* sysdeps/ieee754/dbl-64/dla.h: Likewise.
+	* sysdeps/ieee754/dbl-64/doasin.h: Likewise.
+	* sysdeps/ieee754/dbl-64/dosincos.h: Likewise.
+	* sysdeps/ieee754/dbl-64/mpa.h: Likewise.
+	* sysdeps/ieee754/dbl-64/mpa2.h: Likewise.
+	* sysdeps/ieee754/dbl-64/mpatan.h: Likewise.
+	* sysdeps/ieee754/dbl-64/mpexp.h: Likewise.
+	* sysdeps/ieee754/dbl-64/mplog.h: Likewise.
+	* sysdeps/ieee754/dbl-64/mpsqrt.h: Likewise.
+	* sysdeps/ieee754/dbl-64/mydefs.h: Likewise.
+	* sysdeps/ieee754/dbl-64/sincos32.h: Likewise.
+	* sysdeps/ieee754/dbl-64/uasncs.h: Likewise.
+	* sysdeps/ieee754/dbl-64/uexp.h: Likewise.
+	* sysdeps/ieee754/dbl-64/ulog.h: Likewise.
+	* sysdeps/ieee754/dbl-64/upow.h: Likewise.
+	* sysdeps/ieee754/dbl-64/urem.h: Likewise.
+	* sysdeps/ieee754/dbl-64/uroot.h: Likewise.
+	* sysdeps/ieee754/dbl-64/usncs.h: Likewise.
+	* sysdeps/ieee754/dbl-64/utan.h: Likewise.
+
+	* sysdeps/ieee754/dbl-64/branred.c: Corrected the text of the copying
 	permission notice to say Lesser GPL instead of GPL in warranty
 	disclaimer paragraph.
-        * sysdeps/ieee754/dbl-64/doasin.c: Likewise.
-        * sysdeps/ieee754/dbl-64/dosincos.c: Likewise.
-        * sysdeps/ieee754/dbl-64/e_asin.c: Likewise.
-        * sysdeps/ieee754/dbl-64/e_atan2.c: Likewise.
-        * sysdeps/ieee754/dbl-64/e_exp.c: Likewise.
-        * sysdeps/ieee754/dbl-64/e_log.c: Likewise.
-        * sysdeps/ieee754/dbl-64/e_pow.c: Likewise.
-        * sysdeps/ieee754/dbl-64/e_remainder.c: Likewise.
-        * sysdeps/ieee754/dbl-64/e_sqrt.c: Likewise.
-        * sysdeps/ieee754/dbl-64/halfulp.c: Likewise.
-        * sysdeps/ieee754/dbl-64/mpa.c: Likewise.
-        * sysdeps/ieee754/dbl-64/mpatan.c: Likewise.
-        * sysdeps/ieee754/dbl-64/mpatan2.c: Likewise.
-        * sysdeps/ieee754/dbl-64/mpexp.c: Likewise.
-        * sysdeps/ieee754/dbl-64/mplog.c: Likewise.
-        * sysdeps/ieee754/dbl-64/mpsqrt.c: Likewise.
-        * sysdeps/ieee754/dbl-64/mptan.c: Likewise.
-        * sysdeps/ieee754/dbl-64/s_atan.c: Likewise.
-        * sysdeps/ieee754/dbl-64/s_sin.c: Likewise.
-        * sysdeps/ieee754/dbl-64/s_tan.c: Likewise.
-        * sysdeps/ieee754/dbl-64/sincos32.c: Likewise.
-        * sysdeps/ieee754/dbl-64/slowexp.c: Likewise.
-        * sysdeps/ieee754/dbl-64/slowpow.c:  Likewise.
+	* sysdeps/ieee754/dbl-64/doasin.c: Likewise.
+	* sysdeps/ieee754/dbl-64/dosincos.c: Likewise.
+	* sysdeps/ieee754/dbl-64/e_asin.c: Likewise.
+	* sysdeps/ieee754/dbl-64/e_atan2.c: Likewise.
+	* sysdeps/ieee754/dbl-64/e_exp.c: Likewise.
+	* sysdeps/ieee754/dbl-64/e_log.c: Likewise.
+	* sysdeps/ieee754/dbl-64/e_pow.c: Likewise.
+	* sysdeps/ieee754/dbl-64/e_remainder.c: Likewise.
+	* sysdeps/ieee754/dbl-64/e_sqrt.c: Likewise.
+	* sysdeps/ieee754/dbl-64/halfulp.c: Likewise.
+	* sysdeps/ieee754/dbl-64/mpa.c: Likewise.
+	* sysdeps/ieee754/dbl-64/mpatan.c: Likewise.
+	* sysdeps/ieee754/dbl-64/mpatan2.c: Likewise.
+	* sysdeps/ieee754/dbl-64/mpexp.c: Likewise.
+	* sysdeps/ieee754/dbl-64/mplog.c: Likewise.
+	* sysdeps/ieee754/dbl-64/mpsqrt.c: Likewise.
+	* sysdeps/ieee754/dbl-64/mptan.c: Likewise.
+	* sysdeps/ieee754/dbl-64/s_atan.c: Likewise.
+	* sysdeps/ieee754/dbl-64/s_sin.c: Likewise.
+	* sysdeps/ieee754/dbl-64/s_tan.c: Likewise.
+	* sysdeps/ieee754/dbl-64/sincos32.c: Likewise.
+	* sysdeps/ieee754/dbl-64/slowexp.c: Likewise.
+	* sysdeps/ieee754/dbl-64/slowpow.c:  Likewise.
 
 2002-08-20  Roland McGrath  <roland@redhat.com>
 
diff --git a/elf/rtld.c b/elf/rtld.c
index ab02a71ea3..f0f228f352 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -262,12 +262,12 @@ _dl_start (void *arg)
 	INSTALL_DTV ((char *) tlsblock + bootstrap_map.l_tls_offset,
 		     initdtv);
 
-	if (TLS_INIT_TP ((char *) tlsblock + bootstrap_map.l_tls_offset, 1)
+	if (TLS_INIT_TP ((char *) tlsblock + bootstrap_map.l_tls_offset, 0)
 	    != 0)
 	  _dl_fatal_printf ("cannot setup thread-local storage\n");
 # elif TLS_DTV_AT_TP
 	INSTALL_DTV (tlsblock, initdtv);
-	if (TLS_INIT_TP (tlsblock, 1) != 0)
+	if (TLS_INIT_TP (tlsblock, 0) != 0)
 	  _dl_fatal_printf ("cannot setup thread-local storage\n");
 # else
 #  error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
@@ -275,6 +275,8 @@ _dl_start (void *arg)
 
 	/* So far this is module number one.  */
 	bootstrap_map.l_tls_modid = 1;
+	/* The TP got initialized.  */
+	bootstrap_map.l_tls_tp_initialized = 1;
 
 	/* There can only be one PT_TLS entry.  */
 	break;
@@ -371,6 +373,8 @@ _dl_start_final (void *arg, struct link_map *bootstrap_map_p,
       GL(dl_rtld_map).l_tls_initimage = bootstrap_map_p->l_tls_initimage;
       GL(dl_rtld_map).l_tls_offset = bootstrap_map_p->l_tls_offset;
       GL(dl_rtld_map).l_tls_modid = 1;
+      GL(dl_rtld_map).l_tls_tp_initialized
+	= bootstrap_map_p->l_tls_tp_initialized;
     }
 #endif
 
@@ -1476,7 +1480,15 @@ cannot allocate TLS data structures for initial thread");
       _dl_allocate_tls_init (tcbp);
 
       /* And finally install it for the main thread.  */
-      TLS_INIT_TP (tcbp, 0);
+# ifndef HAVE___THREAD
+      TLS_INIT_TP (tcbp, GL(dl_rtld_map).l_tls_tp_initialized);
+# else
+      /* If the compiler supports the __thread keyword we know that
+	 at least ld.so itself uses TLS and therefore the thread
+	 pointer was initialized earlier.  */
+      assert (GL(dl_rtld_map).l_tls_tp_initialized != 0);
+      TLS_INIT_TP (tcbp, 1);
+# endif
     }
 #endif
 
diff --git a/include/link.h b/include/link.h
index ad4e0a4e0c..9c8be662cd 100644
--- a/include/link.h
+++ b/include/link.h
@@ -272,6 +272,9 @@ struct link_map
     ptrdiff_t l_tls_offset;
     /* Index of the module in the dtv array.  */
     size_t l_tls_modid;
+    /* Nonzero if the thread pointer (register or whatever it is) got
+       initialized.  */
+    int l_tls_tp_initialized;
 #endif
   };
 
diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog
index 86848a685e..ce61798bbd 100644
--- a/linuxthreads/ChangeLog
+++ b/linuxthreads/ChangeLog
@@ -1,5 +1,12 @@
 2002-08-20  Ulrich Drepper  <drepper@redhat.com>
 
+	* sysdeps/i386/tls.h (TLS_DO_SET_THREAD_AREA): Second parameter is
+	renamed to secondcall and use is negated.
+	(TLS_SETUP_GS_SEGMENT): Likewise.
+	(TLS_INIT_TP): Likewise.
+	* sysdeps/sh/tls.h (TLS_INIT_TP): Second parameter is renamed to
+	secondcall.
+
 	* sysdeps/i386/tls.h: Use 32-bit operations when handling segment
 	registers.  No need to mask upper 16 bits in this case.
 	* sysdeps/i386/useldt.h: Likewise.
diff --git a/linuxthreads/sysdeps/sh/tls.h b/linuxthreads/sysdeps/sh/tls.h
index dce57a8961..4784053f80 100644
--- a/linuxthreads/sysdeps/sh/tls.h
+++ b/linuxthreads/sysdeps/sh/tls.h
@@ -87,7 +87,7 @@ typedef struct
 /* Code to initially initialize the thread pointer.  This might need
    special attention since 'errno' is not yet available and if the
    operation can cause a failure 'errno' must not be touched.  */
-# define TLS_INIT_TP(descr, firstcall) \
+# define TLS_INIT_TP(descr, secondcall) \
   ({									      \
     void *_descr = (descr);						      \
     int result;								      \
diff --git a/sysdeps/generic/libc-tls.c b/sysdeps/generic/libc-tls.c
index 88b0ccf8fc..71cae95b19 100644
--- a/sysdeps/generic/libc-tls.c
+++ b/sysdeps/generic/libc-tls.c
@@ -137,10 +137,10 @@ __libc_setup_tls (size_t tcbsize, size_t tcbalign)
 
   INSTALL_DTV ((char *) tlsblock + tcb_offset, static_dtv);
 
-  TLS_INIT_TP ((char *) tlsblock + tcb_offset, 1);
+  TLS_INIT_TP ((char *) tlsblock + tcb_offset, 0);
 # elif TLS_DTV_AT_TP
   INSTALL_DTV (tlsblock, static_dtv);
-  TLS_INIT_TP (tlsblock, 1);
+  TLS_INIT_TP (tlsblock, 0);
 # else
 #  error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
 # endif