mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-01 10:06:57 +03:00
* 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.
This commit is contained in:
@ -1,3 +1,12 @@
|
|||||||
|
2002-08-12 Roland McGrath <roland@redhat.com>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2002-08-11 Roland McGrath <roland@redhat.com>
|
2002-08-11 Roland McGrath <roland@redhat.com>
|
||||||
|
|
||||||
* elf/tst-tlsmod4.c (in_dso): Insert a random library call before use
|
* elf/tst-tlsmod4.c (in_dso): Insert a random library call before use
|
||||||
|
@ -248,7 +248,6 @@ _dl_allocate_tls_init (void *result)
|
|||||||
{
|
{
|
||||||
dtv_t *dtv = GET_DTV (result);
|
dtv_t *dtv = GET_DTV (result);
|
||||||
struct dtv_slotinfo_list *listp;
|
struct dtv_slotinfo_list *listp;
|
||||||
bool first_block = true;
|
|
||||||
size_t total = 0;
|
size_t total = 0;
|
||||||
|
|
||||||
/* We have to look prepare the dtv for all currently loaded
|
/* We have to look prepare the dtv for all currently loaded
|
||||||
@ -259,7 +258,7 @@ _dl_allocate_tls_init (void *result)
|
|||||||
{
|
{
|
||||||
size_t cnt;
|
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;
|
struct link_map *map;
|
||||||
void *dest;
|
void *dest;
|
||||||
@ -300,7 +299,7 @@ _dl_allocate_tls_init (void *result)
|
|||||||
}
|
}
|
||||||
|
|
||||||
total += cnt;
|
total += cnt;
|
||||||
if (total > GL(dl_tls_max_dtv_idx))
|
if (total >= GL(dl_tls_max_dtv_idx))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
listp = listp->next;
|
listp = listp->next;
|
||||||
|
@ -162,11 +162,15 @@ __libc_setup_tls (size_t tcbsize, size_t tcbalign)
|
|||||||
GL(dl_tls_dtv_slotinfo_list) = &static_slotinfo.si;
|
GL(dl_tls_dtv_slotinfo_list) = &static_slotinfo.si;
|
||||||
|
|
||||||
/* That is the size of the TLS memory for this object. */
|
/* 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
|
# if TLS_TCB_AT_TP
|
||||||
GL(dl_tls_static_size) = roundup (memsz, align ?: 1) + tcbsize;
|
+ tcbsize
|
||||||
#else
|
# endif
|
||||||
GL(dl_tls_static_size) = roundup (memsz, align ?: 1);
|
);
|
||||||
#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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user