From 8265947da0173ae415bed7123c64ad97bb2af1b5 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 22 Oct 2002 06:22:53 +0000 Subject: * sysdeps/generic/libc-tls.c (__libc_setup_tls): Initialize the static slotinfo list's len member to the proper size, not just 1. Initialize static_map.l_tls_initimage. * elf/dl-open.c (dl_open_worker): Fix loop searching for dtv_slotinfo_list element containing new modules' l_tls_modid. * elf/tst-tls9.c, elf/tst-tls9-static.c: New files. * elf/tst-tlsmod5.c, elf/tst-tlsmod6.c: New files. * elf/Makefile (tests): Add tst-tls9. (tests-static): Add tst-tls9-static. (tst-tls9-static-ENV): New variable. ($(objpfx)tst-tls9-static, $(objpfx)tst-tls9-static.out): New targets. * elf/dl-close.c (remove_slotinfo): Remove an assert; the number of modids used by partially loaded modules being closed can't be known. --- elf/dl-close.c | 5 ++--- elf/dl-open.c | 8 +++++--- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'elf') diff --git a/elf/dl-close.c b/elf/dl-close.c index 3d8122a375..094db533dd 100644 --- a/elf/dl-close.c +++ b/elf/dl-close.c @@ -44,9 +44,8 @@ remove_slotinfo (size_t idx, struct dtv_slotinfo_list *listp, size_t disp, if (listp->next == NULL) { /* The index is not actually valid in the slotinfo list, - because this object was closed before it was fully setup - due to some error. */ - assert (idx - disp == listp->len); + because this object was closed before it was fully set + up due to some error. */ assert (! should_be_there); } else diff --git a/elf/dl-open.c b/elf/dl-open.c index 08efe6958d..0e74996473 100644 --- a/elf/dl-open.c +++ b/elf/dl-open.c @@ -378,17 +378,19 @@ dl_open_worker (void *a) assert (new->l_searchlist.r_list[i]->l_type == lt_loaded); - /* Find the place in the stv slotinfo list. */ + /* Find the place in the dtv slotinfo list. */ listp = GL(dl_tls_dtv_slotinfo_list); prevp = NULL; /* Needed to shut up gcc. */ do { /* Does it fit in the array of this list element? */ - if (idx <= listp->len) + if (idx < listp->len) break; + idx -= listp->len; prevp = listp; + listp = listp->next; } - while ((listp = listp->next) != NULL); + while (listp != NULL); if (listp == NULL) { -- cgit v1.2.3