about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-03-20 22:25:59 +0000
committerUlrich Drepper <drepper@redhat.com>2005-03-20 22:25:59 +0000
commit167d5acc0d83877cb8651571fd27d8367281a5b9 (patch)
tree7772d18d3924b89f8c713b4e94067b9ad2ecf89b /sysdeps
parent8622e9505d8a49b4a9180838c439a19ff427e965 (diff)
downloadglibc-167d5acc0d83877cb8651571fd27d8367281a5b9.tar.gz
glibc-167d5acc0d83877cb8651571fd27d8367281a5b9.tar.xz
glibc-167d5acc0d83877cb8651571fd27d8367281a5b9.zip
[BZ #786]
2005-03-15  Jakub Jelinek  <jakub@redhat.com>
	[BZ #786]
	* sysdeps/generic/dl-tls.c (_dl_next_tls_modid): Handle
	GL(dl_tls_static_nelem) == GL(dl_tls_max_dtv_idx).
	* elf/Makefile: Add rules to build and run tst-tls15.
	* elf/tst-tls15.c: New test.
	* elf/tst-tlsmod15a.c: New file.
	* elf/tst-tlsmod15b.c: New file.

2005-03-20  Ulrich Drepper  <drepper@redhat.com>

	* elf/rtld.c (dl_main): Always call init_tls if we have audit modules.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/dl-tls.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/sysdeps/generic/dl-tls.c b/sysdeps/generic/dl-tls.c
index fdd569b587..4fed570d5c 100644
--- a/sysdeps/generic/dl-tls.c
+++ b/sysdeps/generic/dl-tls.c
@@ -71,26 +71,24 @@ _dl_next_tls_modid (void)
 	 NB: the offset +1 is due to the fact that DTV[0] is used
 	 for something else.  */
       result = GL(dl_tls_static_nelem) + 1;
-      /* If the following would not be true we mustn't have assumed
-	 there is a gap.  */
-      assert (result <= GL(dl_tls_max_dtv_idx));
-      do
-	{
-	  while (result - disp < runp->len)
-	    {
-	      if (runp->slotinfo[result - disp].map == NULL)
-		break;
-
-	      ++result;
-	      assert (result <= GL(dl_tls_max_dtv_idx) + 1);
-	    }
-
-	  if (result - disp < runp->len)
-	    break;
-
-	  disp += runp->len;
-	}
-      while ((runp = runp->next) != NULL);
+      if (result <= GL(dl_tls_max_dtv_idx))
+	do
+	  {
+	    while (result - disp < runp->len)
+	      {
+		if (runp->slotinfo[result - disp].map == NULL)
+		  break;
+
+		++result;
+		assert (result <= GL(dl_tls_max_dtv_idx) + 1);
+	      }
+
+	    if (result - disp < runp->len)
+	      break;
+
+	    disp += runp->len;
+	  }
+	while ((runp = runp->next) != NULL);
 
       if (result > GL(dl_tls_max_dtv_idx))
 	{