aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/generic/libc-tls.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-08-12 08:48:51 +0000
committerRoland McGrath <roland@gnu.org>2002-08-12 08:48:51 +0000
commitf7c1f4dd1cc23e3defe17651a16e16b5f6ca8346 (patch)
tree8908e5a5740b4448a85a406f437d244612d896ea /sysdeps/generic/libc-tls.c
parente6f526809dbca3e772147b7bdedc3ebca8aff30e (diff)
downloadglibc-f7c1f4dd1cc23e3defe17651a16e16b5f6ca8346.zip
glibc-f7c1f4dd1cc23e3defe17651a16e16b5f6ca8346.tar.gz
glibc-f7c1f4dd1cc23e3defe17651a16e16b5f6ca8346.tar.bz2
* sysdeps/generic/dl-tls.c (_dl_allocate_tls_init): Fix inner loop
start count condition, use TOTAL instead of variable that was never set. Fix outer loop termination condition to TOTAL >= after update. * sysdeps/generic/libc-tls.c (__libc_setup_tls): Initialize dl_tls_static_align and dl_tls_static_nelem.
Diffstat (limited to 'sysdeps/generic/libc-tls.c')
-rw-r--r--sysdeps/generic/libc-tls.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sysdeps/generic/libc-tls.c b/sysdeps/generic/libc-tls.c
index af8b886..cc56a44 100644
--- a/sysdeps/generic/libc-tls.c
+++ b/sysdeps/generic/libc-tls.c
@@ -162,11 +162,15 @@ __libc_setup_tls (size_t tcbsize, size_t tcbalign)
GL(dl_tls_dtv_slotinfo_list) = &static_slotinfo.si;
/* That is the size of the TLS memory for this object. */
+ GL(dl_tls_static_size) = (roundup (memsz, align ?: 1)
# if TLS_TCB_AT_TP
- GL(dl_tls_static_size) = roundup (memsz, align ?: 1) + tcbsize;
-#else
- GL(dl_tls_static_size) = roundup (memsz, align ?: 1);
-#endif
+ + tcbsize
+# endif
+ );
+ /* The alignment requirement for the static TLS block. */
+ GL(dl_tls_static_align) = MAX (TLS_TCB_ALIGN, max_align);
+ /* Number of elements in the static TLS block. */
+ GL(dl_tls_static_nelem) = GL(dl_tls_max_dtv_idx);
}