diff options
Diffstat (limited to 'elf/rtld.c')
-rw-r--r-- | elf/rtld.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/elf/rtld.c b/elf/rtld.c index e78001c2a4..edfa95b70c 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -51,6 +51,7 @@ #include <dl-tunables.h> #include <get-dynamic-info.h> #include <dl-execve.h> +#include <dl-find_object.h> #include <assert.h> @@ -582,6 +583,10 @@ _dl_start (void *arg) __rtld_malloc_init_stubs (); + /* Do not use an initializer for these members because it would + intefere with __rtld_static_init. */ + GLRO (dl_find_object) = &_dl_find_object; + { #ifdef DONT_USE_BOOTSTRAP_MAP ElfW(Addr) entry = _dl_start_final (arg); @@ -2335,6 +2340,9 @@ dl_main (const ElfW(Phdr) *phdr, rtld_timer_stop (&relocate_time, start); } + /* Set up the object lookup structures. */ + _dl_find_object_init (); + /* The library defining malloc has already been relocated due to prelinking. Resolve the malloc symbols for the dynamic loader. */ @@ -2443,6 +2451,9 @@ dl_main (const ElfW(Phdr) *phdr, re-relocation, we might call a user-supplied function (e.g. calloc from _dl_relocate_object) that uses TLS data. */ + /* Set up the object lookup structures. */ + _dl_find_object_init (); + /* The malloc implementation has been relocated, so resolving its symbols (and potentially calling IFUNC resolvers) is safe at this point. */ |