summary refs log tree commit diff
path: root/elf/dl-fini.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-05-08 15:29:32 +0000
committerUlrich Drepper <drepper@redhat.com>2000-05-08 15:29:32 +0000
commit3b3938c9f4cbc473ba598690710465d6e115b30f (patch)
tree9faa2c0a425914f553fd974db9beede708e8f37a /elf/dl-fini.c
parent0320a5aad4a06bc305c0843ee21e197c1d2ed65b (diff)
downloadglibc-3b3938c9f4cbc473ba598690710465d6e115b30f.tar.gz
glibc-3b3938c9f4cbc473ba598690710465d6e115b30f.tar.xz
glibc-3b3938c9f4cbc473ba598690710465d6e115b30f.zip
Update.
2000-05-08  Jakub Jelinek  <jakub@redhat.com>

	* elf/dl-fini.c (_dl_fini): Bump l_opencount of all objects so that
	they are not dlclose'd from underneath us.
Diffstat (limited to 'elf/dl-fini.c')
-rw-r--r--elf/dl-fini.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/elf/dl-fini.c b/elf/dl-fini.c
index f218689628..9b103aeb7e 100644
--- a/elf/dl-fini.c
+++ b/elf/dl-fini.c
@@ -58,7 +58,13 @@ _dl_fini (void)
      the pointers in.  */
   maps = (struct link_map **) alloca (nloaded * sizeof (struct link_map *));
   for (l = _dl_loaded, nloaded = 0; l != NULL; l = l->l_next)
-    maps[nloaded++] = l;
+    {
+      maps[nloaded++] = l;
+
+      /* Bump l_opencount of all objects so that they are not dlclose()ed
+	 from underneath us.  */
+      ++l->l_opencount;
+    }
 
   /* Now we have to do the sorting.  */
   for (l = _dl_loaded->l_next; l != NULL; l = l->l_next)