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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 1ad16a0d65..f8660665e0 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -2111,7 +2111,9 @@ _dl_map_object (struct link_map *loader, const char *name,
 	    {
 #ifdef SHARED
 	      // XXX Correct to unconditionally default to namespace 0?
-	      l = loader ?: GL(dl_ns)[LM_ID_BASE]._ns_loaded;
+	      l = (loader
+		   ?: GL(dl_ns)[LM_ID_BASE]._ns_loaded
+		   ?: &GL(dl_rtld_map));
 #else
 	      l = loader;
 #endif