diff options
Diffstat (limited to 'elf')
-rw-r--r-- | elf/Makefile | 2 | ||||
-rw-r--r-- | elf/dl-open.c | 7 | ||||
-rw-r--r-- | elf/rtld.c | 4 |
3 files changed, 12 insertions, 1 deletions
diff --git a/elf/Makefile b/elf/Makefile index be7604de8e..712fd99a57 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -99,7 +99,7 @@ ifneq (ld.so, $(rtld-installed-name)) # against it. $(objpfx)$(rtld-installed-name): $(objpfx)ld.so rm -f $@ - ln $< $@ + ln -s $(<F) $@ endif # The Linux-compatible dynamic linker shared object is just the same diff --git a/elf/dl-open.c b/elf/dl-open.c index 373d32dd79..8171837236 100644 --- a/elf/dl-open.c +++ b/elf/dl-open.c @@ -32,6 +32,13 @@ _dl_open (struct link_map *parent, const char *file, int mode) struct r_debug *r; +#ifdef PIC + if (! parent) + /* If no particular dependent object caused this load, + then use the DT_RPATH of the executable itself. */ + parent = _dl_loaded; +#endif + /* Load the named object. */ new = _dl_map_object (parent, file, lt_loaded); if (new->l_searchlist) diff --git a/elf/rtld.c b/elf/rtld.c index 7befc0a82f..fb92809ff5 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -239,6 +239,10 @@ of this helper program; chances are you did not intend to run this program.\n", /* Load all the libraries specified by DT_NEEDED entries. */ _dl_map_object_deps (l); + /* We are done mapping things, so close the zero-fill descriptor. */ + __close (_dl_zerofd); + _dl_zerofd = -1; + /* XXX if kept, move it so l_next list is in dep order because it will determine gdb's search order. Perhaps do this always, so later dlopen by name finds it? |