aboutsummaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
Diffstat (limited to 'elf')
-rw-r--r--elf/rtld.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/elf/rtld.c b/elf/rtld.c
index c80fe2740e..304d07a5ba 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -400,9 +400,8 @@ of this helper program; chances are you did not intend to run this program.\n",
main_map->l_entry = *user_entry;
main_map->l_opencount = 1;
- /* Initialize the data structures for the search paths for shared
- objects. */
- _dl_init_paths (NULL);
+ /* We delay initializing the path structure until we got the dynamic
+ information for the program. */
}
/* Scan the program header table for the dynamic section. */
@@ -470,6 +469,11 @@ of this helper program; chances are you did not intend to run this program.\n",
/* Set up our cache of pointers into the hash table. */
_dl_setup_hash (main_map);
+ if (*user_entry != (ElfW(Addr)) &ENTRY_POINT)
+ /* Initialize the data structures for the search paths for shared
+ objects. */
+ _dl_init_paths (NULL);
+
/* Put the link_map for ourselves on the chain so it can be found by
name. Note that at this point the global chain of link maps contains
exactly one element, which is pointed to by main_map. */