about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-load.c3
-rw-r--r--elf/dl-support.c3
-rw-r--r--elf/rtld.c4
3 files changed, 7 insertions, 3 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 0adddf5aaa..a7162eb77d 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -787,9 +787,6 @@ _dl_init_paths (const char *llp)
     }
   else
     env_path_list.dirs = (void *) -1;
-
-  /* Remember the last search directory added at startup.  */
-  GLRO(dl_init_all_dirs) = GL(dl_all_dirs);
 }
 
 
diff --git a/elf/dl-support.c b/elf/dl-support.c
index f94d2c4c6e..5897b32e8c 100644
--- a/elf/dl-support.c
+++ b/elf/dl-support.c
@@ -264,6 +264,9 @@ _dl_non_dynamic_init (void)
      objects.  */
   _dl_init_paths (getenv ("LD_LIBRARY_PATH"));
 
+  /* Remember the last search directory added at startup.  */
+  _dl_init_all_dirs = GL(dl_all_dirs);
+
   _dl_lazy = *(getenv ("LD_BIND_NOW") ?: "") == '\0';
 
   _dl_bind_not = *(getenv ("LD_BIND_NOT") ?: "") != '\0';
diff --git a/elf/rtld.c b/elf/rtld.c
index 90f3ff126e..5ecc4fe711 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -2291,6 +2291,10 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
 			  lossage);
     }
 
+  /* Remember the last search directory added at startup, now that
+     malloc will no longer be the one from dl-minimal.c.  */
+  GLRO(dl_init_all_dirs) = GL(dl_all_dirs);
+
   if (! prelinked && rtld_multiple_ref)
     {
       /* There was an explicit ref to the dynamic linker as a shared lib.