aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/generic/dl-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/dl-tls.c
parente6f526809dbca3e772147b7bdedc3ebca8aff30e (diff)
downloadglibc-f7c1f4dd1cc23e3defe17651a16e16b5f6ca8346.tar
glibc-f7c1f4dd1cc23e3defe17651a16e16b5f6ca8346.tar.gz
glibc-f7c1f4dd1cc23e3defe17651a16e16b5f6ca8346.tar.bz2
glibc-f7c1f4dd1cc23e3defe17651a16e16b5f6ca8346.zip
* 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/dl-tls.c')
-rw-r--r--sysdeps/generic/dl-tls.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sysdeps/generic/dl-tls.c b/sysdeps/generic/dl-tls.c
index 887f037879..cb46460d25 100644
--- a/sysdeps/generic/dl-tls.c
+++ b/sysdeps/generic/dl-tls.c
@@ -248,7 +248,6 @@ _dl_allocate_tls_init (void *result)
{
dtv_t *dtv = GET_DTV (result);
struct dtv_slotinfo_list *listp;
- bool first_block = true;
size_t total = 0;
/* We have to look prepare the dtv for all currently loaded
@@ -259,7 +258,7 @@ _dl_allocate_tls_init (void *result)
{
size_t cnt;
- for (cnt = first_block ? 1 : 0; cnt < listp->len; ++cnt)
+ for (cnt = total == 0 ? 1 : 0; cnt < listp->len; ++cnt)
{
struct link_map *map;
void *dest;
@@ -300,7 +299,7 @@ _dl_allocate_tls_init (void *result)
}
total += cnt;
- if (total > GL(dl_tls_max_dtv_idx))
+ if (total >= GL(dl_tls_max_dtv_idx))
break;
listp = listp->next;