aboutsummaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-06-14 12:05:04 +0000
committerRoland McGrath <roland@gnu.org>1996-06-14 12:05:04 +0000
commitf332db025658c36adaad3759d438ef5117a595c8 (patch)
tree2991fb69f1636a5fdaac65487bdae343535bc6c8 /elf
parent9f70e81bcaa12b0673cd0879d6f4a21ad6dddce5 (diff)
downloadglibc-f332db025658c36adaad3759d438ef5117a595c8.tar
glibc-f332db025658c36adaad3759d438ef5117a595c8.tar.gz
glibc-f332db025658c36adaad3759d438ef5117a595c8.tar.bz2
glibc-f332db025658c36adaad3759d438ef5117a595c8.zip
Fri Jun 14 01:51:47 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>cvs/libc-960615
* version.c (banner): New static const variable, complete version banner text. (__libc_print_version): Use it, and use __write instead of printf. * configure.in (sysnames): Don't cache the value, because it depends only on libc sources. Merge uniquifying third pass into Implies/parent expansion second pass. Report each unique name as it is added in partial report string, terminated when finished. * Makeconfig (sysdep_dir): Move defn before config.status rule that expands it. (sysdep-configures): Variable removed. (config.status): Use its contents directly, tighten up a bit, and include Implies files. * elf/dl-open.c (_dl_open) [PIC]: Set PARENT to _dl_loaded if null. * elf/Makefile ($(objpfx)$(rtld-installed-name)): Make a symlink. * sysdeps/mach/hurd/dl-sysdep.c (_dl_sysdep_open_zero_fill): Add comment. * elf/rtld.c (dl_main): Close _dl_zerofd after mapping deps. * sysdeps/generic/machine-gmon.h [NO_UNDERSCORES]: Define mcount as weak alias for _mcount. * sysdeps/alpha/_mcount.S (mcount): Define as weak alias.
Diffstat (limited to 'elf')
-rw-r--r--elf/Makefile2
-rw-r--r--elf/dl-open.c7
-rw-r--r--elf/rtld.c4
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?