From: Ulrich Drepper Date: Sat, 16 Feb 2002 00:21:33 +0000 (+0000) Subject: Update. X-Git-Tag: cvs/glibc-2-3~1068 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b209e34ad62446d73e5b83ef3cf3a874d2da57d3;p=thirdparty%2Fglibc.git Update. 2002-02-15 Ulrich Drepper * elf/dl-open.c (dl_open_worker): Catch wrap-around of TLS generation counter. * elf/dl-close.c (_dl_close): Likewise. --- diff --git a/ChangeLog b/ChangeLog index 2b20e9a81f9..38c51ec841e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-02-15 Ulrich Drepper + + * 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 * elf/Makefile: Add rules to build and run tst-tls8. diff --git a/elf/dl-close.c b/elf/dl-close.c index a5941268b9f..65992d5c80f 100644 --- a/elf/dl-close.c +++ b/elf/dl-close.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -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. */ diff --git a/elf/dl-open.c b/elf/dl-open.c index 6fcfcce3cef..5710ffb40ff 100644 --- a/elf/dl-open.c +++ b/elf/dl-open.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -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. */