about summary refs log tree commit diff
path: root/elf/dl-close.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-02-14 03:54:02 +0000
committerUlrich Drepper <drepper@redhat.com>2002-02-14 03:54:02 +0000
commitbb4cb25213ce21326236d72e8633844e4a777a8b (patch)
treebd5beb6cab8d11d014acabe022e54d8efb8915e4 /elf/dl-close.c
parent736ab899c4ab56dea0d329583f73e3f2b54a1dc1 (diff)
downloadglibc-bb4cb25213ce21326236d72e8633844e4a777a8b.tar.gz
glibc-bb4cb25213ce21326236d72e8633844e4a777a8b.tar.xz
glibc-bb4cb25213ce21326236d72e8633844e4a777a8b.zip
Update.
	* elf/dl-close.c (_dl_close): When closing an object using TLS
	either decrement dl_tls_max_dtv_idx or set dl_tls_dtv_gaps to
	true.  Increment dl_tls_generation only if we closed any TLS-using
	object.
	* elf/tst-tls6.c: New file.
	* elf/Makefile: Add rules to build and run tst-tls6.
Diffstat (limited to 'elf/dl-close.c')
-rw-r--r--elf/dl-close.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/elf/dl-close.c b/elf/dl-close.c
index 8eefb351b2..7e7547de99 100644
--- a/elf/dl-close.c
+++ b/elf/dl-close.c
@@ -228,6 +228,11 @@ _dl_close (void *_map)
 	      listp->slotinfo[idx].map = NULL;
 
 	      any_tls = true;
+
+	      if (imap->l_tls_modid == GL(dl_tls_max_dtv_idx))
+		--GL(dl_tls_max_dtv_idx);
+	      else
+		GL(dl_tls_dtv_gaps) = true;
 	    }
 #endif
 
@@ -307,7 +312,8 @@ _dl_close (void *_map)
 #ifdef USE_TLS
   /* If we removed any object which uses TLS bumnp the generation
      counter.  */
-  ++GL(dl_tls_generation);
+  if (any_tls)
+    ++GL(dl_tls_generation);
 #endif
 
   /* Notify the debugger those objects are finalized and gone.  */