summary refs log tree commit diff
path: root/elf/rtld.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/rtld.c')
-rw-r--r--elf/rtld.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/elf/rtld.c b/elf/rtld.c
index 74a8f3b05b..0402727c52 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -395,7 +395,8 @@ of this helper program; chances are you did not intend to run this program.\n",
     {
       /* Create a link_map for the executable itself.
 	 This will be what dlopen on "" returns.  */
-      main_map = _dl_new_object ((char *) "", "", lt_executable);
+      main_map = _dl_new_object (_dl_argv[0] ?: (char *) "<main program>",
+				 "", lt_executable);
       if (main_map == NULL)
 	_dl_sysdep_fatal ("cannot allocate memory for link map\n", NULL);
       main_map->l_phdr = phdr;