aboutsummaryrefslogtreecommitdiff
path: root/elf/dl-close.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/dl-close.c')
-rw-r--r--elf/dl-close.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/elf/dl-close.c b/elf/dl-close.c
index a5941268b9..65992d5c80 100644
--- a/elf/dl-close.c
+++ b/elf/dl-close.c
@@ -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. */