about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-close.c3
-rw-r--r--elf/dl-open.c4
2 files changed, 4 insertions, 3 deletions
diff --git a/elf/dl-close.c b/elf/dl-close.c
index 184d38298e..0a16d69f0d 100644
--- a/elf/dl-close.c
+++ b/elf/dl-close.c
@@ -99,7 +99,8 @@ _dl_close (struct link_map *map)
 	      }
 
 	  /* Finally, unlink the data structure and free it.  */
-	  map->l_prev->l_next = map->l_next;
+	  if (map->l_prev)
+	    map->l_prev->l_next = map->l_next;
 	  if (map->l_next)
 	    map->l_next->l_prev = map->l_prev;
 	  if (map->l_searchlist)
diff --git a/elf/dl-open.c b/elf/dl-open.c
index 76f6329762..ff19f811d5 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -29,8 +29,8 @@ extern int __libc_multiple_libcs;	/* Defined in init-first.c.  */
 
 extern int __libc_argc;
 extern char **__libc_argv;
-extern char **__libc_envp;
 
+extern char **__environ;
 
 size_t _dl_global_scope_alloc;
 
@@ -142,7 +142,7 @@ _dl_open (const char *file, int mode)
   /* Run the initializer functions of new objects.  */
   while (init = _dl_init_next (new))
     (*(void (*) (int, char **, char **)) init) (__libc_argc, __libc_argv,
-						__libc_envp);
+						__environ);
 
   if (dl_start_ptr == NULL)
     /* We must be the static _dl_open in libc.a because ld.so.1 is not