about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
Diffstat (limited to 'elf')
-rw-r--r--elf/rtld.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/elf/rtld.c b/elf/rtld.c
index 032bb8ee87..b34d8598bb 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -263,7 +263,8 @@ of this helper program; chances are you did not intend to run this program.\n",
       /* No DT_NEEDED entry referred to the interpreter object itself,
 	 so remove it from the list of visible objects.  */
       _dl_rtld_map.l_prev->l_next = _dl_rtld_map.l_next;
-      _dl_rtld_map.l_next->l_prev = _dl_rtld_map.l_prev;
+      if (_dl_rtld_map.l_next)
+	_dl_rtld_map.l_next->l_prev = _dl_rtld_map.l_prev;
     }
 
   if (list_only)