Update.
authorUlrich Drepper <drepper@redhat.com>
Sat, 16 Feb 2002 00:21:33 +0000 (00:21 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 16 Feb 2002 00:21:33 +0000 (00:21 +0000)
2002-02-15  Ulrich Drepper  <drepper@redhat.com>

* elf/dl-open.c (dl_open_worker): Catch wrap-around of TLS
generation counter.
* elf/dl-close.c (_dl_close): Likewise.

ChangeLog
elf/dl-close.c
elf/dl-open.c

index 2b20e9a..38c51ec 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-02-15  Ulrich Drepper  <drepper@redhat.com>
+
+       * elf/dl-open.c (dl_open_worker): Catch wrap-around of TLS
+       generation counter.
+       * elf/dl-close.c (_dl_close): Likewise.
+
 2002-02-14  Ulrich Drepper  <drepper@redhat.com>
 
        * elf/Makefile: Add rules to build and run tst-tls8.
index a594126..65992d5 100644 (file)
@@ -20,6 +20,7 @@
 #include <assert.h>
 #include <dlfcn.h>
 #include <libintl.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <bits/libc-lock.h>
@@ -352,7 +353,8 @@ _dl_close (void *_map)
   /* If we removed any object which uses TLS bumnp the generation
      counter.  */
   if (any_tls)
-    ++GL(dl_tls_generation);
+    if (__builtin_expect (++GL(dl_tls_generation) == 0, 0))
+      __libc_fatal (gettext ("TLS generation counter wrapped!  Please send report with the 'glibcbug' script."));
 #endif
 
   /* Notify the debugger those objects are finalized and gone.  */
index 6fcfcce..5710ffb 100644 (file)
@@ -21,6 +21,7 @@
 #include <dlfcn.h>
 #include <errno.h>
 #include <libintl.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
@@ -431,7 +432,8 @@ dl_open_worker (void *a)
 
   /* Bump the generation number if necessary.  */
   if (any_tls)
-    ++GL(dl_tls_generation);
+    if (__builtin_expect (++GL(dl_tls_generation) == 0, 0))
+      __libc_fatal (gettext ("TLS generation counter wrapped!  Please send report with the 'glibcbug' script."));
 #endif
 
   /* Run the initializer functions of new objects.  */