2002-10-21 Roland McGrath <roland@redhat.com>
authorroland <roland>
Tue, 22 Oct 2002 06:22:44 +0000 (06:22 +0000)
committerroland <roland>
Tue, 22 Oct 2002 06:22:44 +0000 (06:22 +0000)
* elf/dl-open.c (dl_open_worker): Fix loop searching for
dtv_slotinfo_list element containing new modules' l_tls_modid.

elf/dl-open.c

index 08efe69..0e74996 100644 (file)
@@ -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)
          {