about summary refs log tree commit diff
path: root/elf/dl-open.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-02-13 09:44:17 +0000
committerUlrich Drepper <drepper@redhat.com>2002-02-13 09:44:17 +0000
commitd552a4310cc5fec18083fe6bfe9ffa96cfa5df77 (patch)
treecade81bfad8968a13f4ded858eefcec68f567b9c /elf/dl-open.c
parenta04586d84dadaf9023ad44a26ee2241a09e4499f (diff)
downloadglibc-d552a4310cc5fec18083fe6bfe9ffa96cfa5df77.tar.gz
glibc-d552a4310cc5fec18083fe6bfe9ffa96cfa5df77.tar.xz
glibc-d552a4310cc5fec18083fe6bfe9ffa96cfa5df77.zip
Update.
	* elf/dl-open.c (dl_open_worker): Only bump the generation counter
	if this is really necessary.
Diffstat (limited to 'elf/dl-open.c')
-rw-r--r--elf/dl-open.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/elf/dl-open.c b/elf/dl-open.c
index c7acd74964..6fcfcce3ce 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -155,6 +155,9 @@ dl_open_worker (void *a)
   const char *dst;
   int lazy;
   unsigned int i;
+#ifdef USE_TLS
+  bool any_tls;
+#endif
 
   /* Maybe we have to expand a DST.  */
   dst = strchr (file, '$');
@@ -292,6 +295,12 @@ dl_open_worker (void *a)
       l = l->l_prev;
     }
 
+#ifdef USE_TLS
+  /* We normally don't bump the TLS generation counter.  There must be
+     actually a need to do this.  */
+  any_tls = false;
+#endif
+
   /* Increment the open count for all dependencies.  If the file is
      not loaded as a dependency here add the search list of the newly
      loaded object to the scope.  */
@@ -415,10 +424,14 @@ dl_open_worker (void *a)
 	/* Add the information into the slotinfo data structure.  */
 	listp->slotinfo[idx].map = new->l_searchlist.r_list[i];
 	listp->slotinfo[idx].gen = GL(dl_tls_generation) + 1;
+
+	/* We have to bump the generation counter.  */
+	any_tls = true;
       }
 
-  /* Bump the generation number.  */
-  ++GL(dl_tls_generation);
+  /* Bump the generation number if necessary.  */
+  if (any_tls)
+    ++GL(dl_tls_generation);
 #endif
 
   /* Run the initializer functions of new objects.  */