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.
This commit is contained in:
Ulrich Drepper 2002-08-21 00:17:09 +00:00
parent 845f758a39
commit 9d69bd2492
6 changed files with 105 additions and 73 deletions

144
ChangeLog
View File

@ -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> 2002-08-15 Jakub Jelinek <jakub@redhat.com>
* locale/programs/localedef.c (add_to_readlist): Error about * locale/programs/localedef.c (add_to_readlist): Error about
@ -11,87 +21,87 @@
* locale/programs/locarchive.c (enlarge_archive): If quiet, don't * locale/programs/locarchive.c (enlarge_archive): If quiet, don't
print any messages about enlarging archive. 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 * manual/contrib.texi: Removed licenses, added acknowledgements
for contributions by Intel, IBM, Craig Metz. for contributions by Intel, IBM, Craig Metz.
* LICENSES: New file, contains the text of all non-FSF licenses in the * LICENSES: New file, contains the text of all non-FSF licenses in the
distribution that require putting the notice in the accompanying distribution that require putting the notice in the accompanying
documentation. documentation.
* README.template, README: Mention LICENSES. * README.template, README: Mention LICENSES.
* sysdeps/mach/hurd/net/if_ppp.h: Replaced CMU license with a * sysdeps/mach/hurd/net/if_ppp.h: Replaced CMU license with a
new one modelled on the modern BSD license, per recent letter new one modelled on the modern BSD license, per recent letter
of permission from CMU. of permission from CMU.
* sysdeps/unix/sysv/linux/net/if_ppp.h: Likewise. * sysdeps/unix/sysv/linux/net/if_ppp.h: Likewise.
* sysdeps/ieee754/dbl-64/MathLib.h: Changed the copyright holder * sysdeps/ieee754/dbl-64/MathLib.h: Changed the copyright holder
from IBM to FSF, per the recent Software Letter. Changed the from IBM to FSF, per the recent Software Letter. Changed the
distribution terms from GPL to LGPL. distribution terms from GPL to LGPL.
* sysdeps/ieee754/dbl-64/asincos.tbl: Added FSF copyright and * sysdeps/ieee754/dbl-64/asincos.tbl: Added FSF copyright and
copying permission notice (Lesser GPL), per recent IBM Software Letter. copying permission notice (Lesser GPL), per recent IBM Software Letter.
* sysdeps/ieee754/dbl-64/powtwo.tbl: Likewise. * sysdeps/ieee754/dbl-64/powtwo.tbl: Likewise.
* sysdeps/ieee754/dbl-64/root.tbl: Likewise. * sysdeps/ieee754/dbl-64/root.tbl: Likewise.
* sysdeps/ieee754/dbl-64/sincos.tbl: Likewise. * sysdeps/ieee754/dbl-64/sincos.tbl: Likewise.
* sysdeps/ieee754/dbl-64/uatan.tbl: Likewise. * sysdeps/ieee754/dbl-64/uatan.tbl: Likewise.
* sysdeps/ieee754/dbl-64/uexp.tbl: Likewise. * sysdeps/ieee754/dbl-64/uexp.tbl: Likewise.
* sysdeps/ieee754/dbl-64/ulog.tbl: Likewise. * sysdeps/ieee754/dbl-64/ulog.tbl: Likewise.
* sysdeps/ieee754/dbl-64/upow.tbl: Likewise. * sysdeps/ieee754/dbl-64/upow.tbl: Likewise.
* sysdeps/ieee754/dbl-64/utan.tbl: Likewise. * sysdeps/ieee754/dbl-64/utan.tbl: Likewise.
* sysdeps/ieee754/dbl-64/atnat.h: Changed the copyright holder * sysdeps/ieee754/dbl-64/atnat.h: Changed the copyright holder
from IBM to FSF, per the recent Software Letter. Corrected the from IBM to FSF, per the recent Software Letter. Corrected the
text of the copying permission notice to say Lesser GPL instead text of the copying permission notice to say Lesser GPL instead
of GPL in warranty disclaimer paragraph. of GPL in warranty disclaimer paragraph.
* sysdeps/ieee754/dbl-64/atnat2.h: Likewise. * sysdeps/ieee754/dbl-64/atnat2.h: Likewise.
* sysdeps/ieee754/dbl-64/branred.h: Likewise. * sysdeps/ieee754/dbl-64/branred.h: Likewise.
* sysdeps/ieee754/dbl-64/dla.h: Likewise. * sysdeps/ieee754/dbl-64/dla.h: Likewise.
* sysdeps/ieee754/dbl-64/doasin.h: Likewise. * sysdeps/ieee754/dbl-64/doasin.h: Likewise.
* sysdeps/ieee754/dbl-64/dosincos.h: Likewise. * sysdeps/ieee754/dbl-64/dosincos.h: Likewise.
* sysdeps/ieee754/dbl-64/mpa.h: Likewise. * sysdeps/ieee754/dbl-64/mpa.h: Likewise.
* sysdeps/ieee754/dbl-64/mpa2.h: Likewise. * sysdeps/ieee754/dbl-64/mpa2.h: Likewise.
* sysdeps/ieee754/dbl-64/mpatan.h: Likewise. * sysdeps/ieee754/dbl-64/mpatan.h: Likewise.
* sysdeps/ieee754/dbl-64/mpexp.h: Likewise. * sysdeps/ieee754/dbl-64/mpexp.h: Likewise.
* sysdeps/ieee754/dbl-64/mplog.h: Likewise. * sysdeps/ieee754/dbl-64/mplog.h: Likewise.
* sysdeps/ieee754/dbl-64/mpsqrt.h: Likewise. * sysdeps/ieee754/dbl-64/mpsqrt.h: Likewise.
* sysdeps/ieee754/dbl-64/mydefs.h: Likewise. * sysdeps/ieee754/dbl-64/mydefs.h: Likewise.
* sysdeps/ieee754/dbl-64/sincos32.h: Likewise. * sysdeps/ieee754/dbl-64/sincos32.h: Likewise.
* sysdeps/ieee754/dbl-64/uasncs.h: Likewise. * sysdeps/ieee754/dbl-64/uasncs.h: Likewise.
* sysdeps/ieee754/dbl-64/uexp.h: Likewise. * sysdeps/ieee754/dbl-64/uexp.h: Likewise.
* sysdeps/ieee754/dbl-64/ulog.h: Likewise. * sysdeps/ieee754/dbl-64/ulog.h: Likewise.
* sysdeps/ieee754/dbl-64/upow.h: Likewise. * sysdeps/ieee754/dbl-64/upow.h: Likewise.
* sysdeps/ieee754/dbl-64/urem.h: Likewise. * sysdeps/ieee754/dbl-64/urem.h: Likewise.
* sysdeps/ieee754/dbl-64/uroot.h: Likewise. * sysdeps/ieee754/dbl-64/uroot.h: Likewise.
* sysdeps/ieee754/dbl-64/usncs.h: Likewise. * sysdeps/ieee754/dbl-64/usncs.h: Likewise.
* sysdeps/ieee754/dbl-64/utan.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/branred.c: Corrected the text of the copying
permission notice to say Lesser GPL instead of GPL in warranty permission notice to say Lesser GPL instead of GPL in warranty
disclaimer paragraph. disclaimer paragraph.
* sysdeps/ieee754/dbl-64/doasin.c: Likewise. * sysdeps/ieee754/dbl-64/doasin.c: Likewise.
* sysdeps/ieee754/dbl-64/dosincos.c: Likewise. * sysdeps/ieee754/dbl-64/dosincos.c: Likewise.
* sysdeps/ieee754/dbl-64/e_asin.c: Likewise. * sysdeps/ieee754/dbl-64/e_asin.c: Likewise.
* sysdeps/ieee754/dbl-64/e_atan2.c: Likewise. * sysdeps/ieee754/dbl-64/e_atan2.c: Likewise.
* sysdeps/ieee754/dbl-64/e_exp.c: Likewise. * sysdeps/ieee754/dbl-64/e_exp.c: Likewise.
* sysdeps/ieee754/dbl-64/e_log.c: Likewise. * sysdeps/ieee754/dbl-64/e_log.c: Likewise.
* sysdeps/ieee754/dbl-64/e_pow.c: Likewise. * sysdeps/ieee754/dbl-64/e_pow.c: Likewise.
* sysdeps/ieee754/dbl-64/e_remainder.c: Likewise. * sysdeps/ieee754/dbl-64/e_remainder.c: Likewise.
* sysdeps/ieee754/dbl-64/e_sqrt.c: Likewise. * sysdeps/ieee754/dbl-64/e_sqrt.c: Likewise.
* sysdeps/ieee754/dbl-64/halfulp.c: Likewise. * sysdeps/ieee754/dbl-64/halfulp.c: Likewise.
* sysdeps/ieee754/dbl-64/mpa.c: Likewise. * sysdeps/ieee754/dbl-64/mpa.c: Likewise.
* sysdeps/ieee754/dbl-64/mpatan.c: Likewise. * sysdeps/ieee754/dbl-64/mpatan.c: Likewise.
* sysdeps/ieee754/dbl-64/mpatan2.c: Likewise. * sysdeps/ieee754/dbl-64/mpatan2.c: Likewise.
* sysdeps/ieee754/dbl-64/mpexp.c: Likewise. * sysdeps/ieee754/dbl-64/mpexp.c: Likewise.
* sysdeps/ieee754/dbl-64/mplog.c: Likewise. * sysdeps/ieee754/dbl-64/mplog.c: Likewise.
* sysdeps/ieee754/dbl-64/mpsqrt.c: Likewise. * sysdeps/ieee754/dbl-64/mpsqrt.c: Likewise.
* sysdeps/ieee754/dbl-64/mptan.c: Likewise. * sysdeps/ieee754/dbl-64/mptan.c: Likewise.
* sysdeps/ieee754/dbl-64/s_atan.c: Likewise. * sysdeps/ieee754/dbl-64/s_atan.c: Likewise.
* sysdeps/ieee754/dbl-64/s_sin.c: Likewise. * sysdeps/ieee754/dbl-64/s_sin.c: Likewise.
* sysdeps/ieee754/dbl-64/s_tan.c: Likewise. * sysdeps/ieee754/dbl-64/s_tan.c: Likewise.
* sysdeps/ieee754/dbl-64/sincos32.c: Likewise. * sysdeps/ieee754/dbl-64/sincos32.c: Likewise.
* sysdeps/ieee754/dbl-64/slowexp.c: Likewise. * sysdeps/ieee754/dbl-64/slowexp.c: Likewise.
* sysdeps/ieee754/dbl-64/slowpow.c: Likewise. * sysdeps/ieee754/dbl-64/slowpow.c: Likewise.
2002-08-20 Roland McGrath <roland@redhat.com> 2002-08-20 Roland McGrath <roland@redhat.com>

View File

@ -262,12 +262,12 @@ _dl_start (void *arg)
INSTALL_DTV ((char *) tlsblock + bootstrap_map.l_tls_offset, INSTALL_DTV ((char *) tlsblock + bootstrap_map.l_tls_offset,
initdtv); 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) != 0)
_dl_fatal_printf ("cannot setup thread-local storage\n"); _dl_fatal_printf ("cannot setup thread-local storage\n");
# elif TLS_DTV_AT_TP # elif TLS_DTV_AT_TP
INSTALL_DTV (tlsblock, initdtv); 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"); _dl_fatal_printf ("cannot setup thread-local storage\n");
# else # else
# error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined" # 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. */ /* So far this is module number one. */
bootstrap_map.l_tls_modid = 1; 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. */ /* There can only be one PT_TLS entry. */
break; 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_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_offset = bootstrap_map_p->l_tls_offset;
GL(dl_rtld_map).l_tls_modid = 1; GL(dl_rtld_map).l_tls_modid = 1;
GL(dl_rtld_map).l_tls_tp_initialized
= bootstrap_map_p->l_tls_tp_initialized;
} }
#endif #endif
@ -1476,7 +1480,15 @@ cannot allocate TLS data structures for initial thread");
_dl_allocate_tls_init (tcbp); _dl_allocate_tls_init (tcbp);
/* And finally install it for the main thread. */ /* 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 #endif

View File

@ -272,6 +272,9 @@ struct link_map
ptrdiff_t l_tls_offset; ptrdiff_t l_tls_offset;
/* Index of the module in the dtv array. */ /* Index of the module in the dtv array. */
size_t l_tls_modid; size_t l_tls_modid;
/* Nonzero if the thread pointer (register or whatever it is) got
initialized. */
int l_tls_tp_initialized;
#endif #endif
}; };

View File

@ -1,5 +1,12 @@
2002-08-20 Ulrich Drepper <drepper@redhat.com> 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 * sysdeps/i386/tls.h: Use 32-bit operations when handling segment
registers. No need to mask upper 16 bits in this case. registers. No need to mask upper 16 bits in this case.
* sysdeps/i386/useldt.h: Likewise. * sysdeps/i386/useldt.h: Likewise.

View File

@ -87,7 +87,7 @@ typedef struct
/* Code to initially initialize the thread pointer. This might need /* Code to initially initialize the thread pointer. This might need
special attention since 'errno' is not yet available and if the special attention since 'errno' is not yet available and if the
operation can cause a failure 'errno' must not be touched. */ 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); \ void *_descr = (descr); \
int result; \ int result; \

View File

@ -137,10 +137,10 @@ __libc_setup_tls (size_t tcbsize, size_t tcbalign)
INSTALL_DTV ((char *) tlsblock + tcb_offset, static_dtv); 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 # elif TLS_DTV_AT_TP
INSTALL_DTV (tlsblock, static_dtv); INSTALL_DTV (tlsblock, static_dtv);
TLS_INIT_TP (tlsblock, 1); TLS_INIT_TP (tlsblock, 0);
# else # else
# error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined" # error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
# endif # endif