diff options
author | Roland McGrath <roland@gnu.org> | 1996-06-14 12:05:04 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1996-06-14 12:05:04 +0000 |
commit | f332db025658c36adaad3759d438ef5117a595c8 (patch) | |
tree | 2991fb69f1636a5fdaac65487bdae343535bc6c8 | |
parent | 9f70e81bcaa12b0673cd0879d6f4a21ad6dddce5 (diff) |
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.
-rw-r--r-- | ChangeLog | 30 | ||||
-rw-r--r-- | Makeconfig | 23 | ||||
-rw-r--r-- | configure.in | 46 | ||||
-rw-r--r-- | elf/Makefile | 2 | ||||
-rw-r--r-- | elf/dl-open.c | 7 | ||||
-rw-r--r-- | elf/rtld.c | 4 | ||||
-rw-r--r-- | sysdeps/mach/hurd/dl-sysdep.c | 2 | ||||
-rw-r--r-- | version.c | 27 |
8 files changed, 90 insertions, 51 deletions
@@ -1,3 +1,24 @@ +Fri Jun 14 01:51:47 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> + + * 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. + Thu Jun 13 14:29:56 1996 Miles Bader <miles@gnu.ai.mit.edu> * hurd/hurdsig.c (_hurd_internal_post_signal): Rename `deliver:' @@ -5,6 +26,15 @@ Thu Jun 13 14:29:56 1996 Miles Bader <miles@gnu.ai.mit.edu> Thu Jun 13 00:02:25 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> + * 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. + * elf/dl-lookup.c (_dl_lookup_symbol): If no value and *REF is null, consider it a strong reference and give the error. diff --git a/Makeconfig b/Makeconfig index 1d534580b1..afbb31f2fa 100644 --- a/Makeconfig +++ b/Makeconfig @@ -74,6 +74,10 @@ common-objdir = . endif endif +# Root of the sysdeps tree. +sysdep_dir := $(..)sysdeps +export sysdep_dir := $(sysdep_dir) + # Get the values defined by options to `configure'. include $(common-objpfx)config.make @@ -86,17 +90,15 @@ include $(common-objpfx)config.make $(common-objpfx)config.make: $(common-objpfx)config.status $(..)config.h.in cd $(<D); $(SHELL) $(<F) +sysdep-configures = \ + # Find all the sysdeps configure fragments, to make sure we re-run # configure when any of them changes. -sysdep-configures = \ - $(foreach dir,$(config-sysdirs),\ - $(patsubst %.in,%,\ - $(firstword $(wildcard \ - $(sysdep_dir)/$(dir)/configure \ - $(sysdep_dir)/$(dir)/configure.in)))) - -# Force the user to configure before making. -$(common-objpfx)config.status: $(..)configure $(sysdep-configures) +$(common-objpfx)config.status: $(..)configure \ + $(foreach dir,$(config-sysdirs),\ + $(patsubst %.in,%,\ + $(firstword $(wildcard \ + $(addprefix $(sysdep_dir)/$(dir)/,configure configure.in Implies))))) @cd $(@D); if test -f $(@F); then exec $(SHELL) $(@F) --recheck; else \ echo The GNU C library has not been configured. >&2; \ echo Run \`configure\' to configure it before building. >&2; \ @@ -112,9 +114,6 @@ ifneq ($(wildcard $(objpfx)configparms),) include $(objpfx)configparms endif endif - -sysdep_dir := $(..)sysdeps -export sysdep_dir := $(sysdep_dir) #### #### These are the configuration variables. You can define values for diff --git a/configure.in b/configure.in index e3154b6a7c..eceb4da989 100644 --- a/configure.in +++ b/configure.in @@ -118,8 +118,9 @@ changequote([,])dnl AC_SUBST(base_machine) # Compute the list of sysdep directories for this configuration. +# This can take a while to compute. sysdep_dir=$srcdir/sysdeps -AC_CACHE_CHECK(sysdep dirs, libc_cv_sysdirs, [dnl +AC_MSG_CHECKING(sysdep dirs) dnl We need to use [ and ] for other purposes for a while now. changequote(,)dnl # Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1. @@ -232,15 +233,26 @@ sysnames="`echo $sysnames | sed -e 's@^/@@' -e 's@ /@ @g'`" # Expand the list of system names into a full list of directories # from each element's parent name and Implies file (if present). set $sysnames +names= seen= while test $# -gt 0; do name=$1 shift + if echo "$seen" | fgrep -x $name >/dev/null; then + # Already in the list. + continue + fi + + # Report each name as we discover it, so there is no long pause in output. + echo $ac_n "$name $ac_c" >&AC_FD_MSG + if test -f $sysdep_dir/$name/Implies; then # Collect more names from the `Implies' file (removing comments). implied="`sed 's/#.*$//' < $sysdep_dir/$name/Implies`" for x in $implied; do - test -d $sysdep_dir/$x || echo "Warning: $name implies nonexistent $x">&2 + test -d $sysdep_dir/$x || { + AC_MSG_WARN(sysdeps/$name/Implies specifies nonexistent $x) + } done else implied= @@ -248,6 +260,9 @@ while test $# -gt 0; do # Add NAME to the list of names. names="$names $name" + # We maintain a parallel newline-separated list for the fgrep check above. + seen="$seen +$name" # Find the parent of NAME, using the empty string if it has none. changequote(,)dnl @@ -266,28 +281,13 @@ changequote([,])dnl done # Add the default directories. -names="$names generic stub" +sysnames="$names generic stub" +AC_SUBST(sysnames) +# The other names were emitted during the scan. +AC_MSG_RESULT(generic stub) -# Now uniquize the list. -seen= -sysnames= -for name in $names; do - if echo "$seen" | fgrep -x $name >/dev/null; then - # Already in the list. - true; - else - # A new one. - if test -z "$seen"; then - seen="$name" sysnames="$name" - else - seen="$seen -$name" - sysnames="$sysnames $name" - fi - fi -done -libc_cv_sysdirs="$sysnames"]) -AC_SUBST(sysnames) sysnames="$libc_cv_sysdirs" + +### Locate tools. AC_PROG_INSTALL if test "$INSTALL" = "${srcdir}/install-sh"; then 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? diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c index 503feaf962..ec53e2f36e 100644 --- a/sysdeps/mach/hurd/dl-sysdep.c +++ b/sysdeps/mach/hurd/dl-sysdep.c @@ -213,6 +213,8 @@ _dl_sysdep_start_cleanup (void) int _dl_sysdep_open_zero_fill (void) { + /* The minimal mmap below uses the fd as a memory object port. + The real mmap used for dlopen ignores the fd for MAP_ANON. */ return (int) MACH_PORT_NULL; } @@ -16,38 +16,35 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <stdio.h> - #include "version.h" const char __libc_release[] = RELEASE; const char __libc_version[] = VERSION; -void -__libc_print_version (void) -{ - printf ("GNU C Library %s release version %s, by Roland McGrath et al.\n", - __libc_release, __libc_version); -#ifdef __VERSION__ - printf ("Compiled by GNU CC version %s.\n", __VERSION__); -#endif - puts ("\ +static const char banner[] = +"GNU C Library "RELEASE" release version "VERSION", by Roland McGrath et al.\n\ +Compiled by GNU CC version "__VERSION__".\n\ Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.\n\ This is free software; see the source for copying conditions.\n\ There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\ -PARTICULAR PURPOSE."); +PARTICULAR PURPOSE."; + +#include <unistd.h> + +void +__libc_print_version (void) +{ + __write (STDOUT_FILENO, banner, sizeof banner - 1); } #ifdef HAVE_ELF /* This function is the entry point for the shared object. Running the library as a program will get here. */ -#include <stdlib.h> - void __libc_main (void) { __libc_print_version (); - exit (0); + _exit (0); } #endif |