about summary refs log tree commit diff
path: root/elf/dl-load.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/dl-load.c')
-rw-r--r--elf/dl-load.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c
index a1e4e5a47f..ffaca6e55d 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -1105,13 +1105,14 @@ _dl_map_object_from_fd (const char *name, int fd, char *realname,
     {
       /* Remove from the module list.  */
       assert (l->l_next == NULL);
-#ifdef SHARED
+#ifndef SHARED
       if (l->l_prev == NULL)
 	/* No other module loaded.  */
 	_dl_loaded = NULL;
       else
 #endif
 	l->l_prev->l_next = NULL;
+      --_dl_nloaded;
 
       /* We are not supposed to load this object.  Free all resources.  */
       __munmap ((void *) l->l_map_start, l->l_map_end - l->l_map_start);