aboutsummaryrefslogtreecommitdiff
path: root/elf
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 /elf
parent845f758a393a75039e20743965a4392688fbe4b1 (diff)
downloadglibc-9d69bd2492a229db2c165b56afb4e8822abe5b62.tar
glibc-9d69bd2492a229db2c165b56afb4e8822abe5b62.tar.gz
glibc-9d69bd2492a229db2c165b56afb4e8822abe5b62.tar.bz2
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.
Diffstat (limited to 'elf')
-rw-r--r--elf/rtld.c18
1 files changed, 15 insertions, 3 deletions
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