1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

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.

	* 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.
This commit is contained in:
Roland McGrath
1996-06-14 12:05:04 +00:00
parent 9f70e81bca
commit f332db0256
8 changed files with 90 additions and 51 deletions

View File

@ -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> Thu Jun 13 14:29:56 1996 Miles Bader <miles@gnu.ai.mit.edu>
* hurd/hurdsig.c (_hurd_internal_post_signal): Rename `deliver:' * 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> 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 * elf/dl-lookup.c (_dl_lookup_symbol): If no value and *REF is
null, consider it a strong reference and give the error. null, consider it a strong reference and give the error.

View File

@ -74,6 +74,10 @@ common-objdir = .
endif endif
endif endif
# Root of the sysdeps tree.
sysdep_dir := $(..)sysdeps
export sysdep_dir := $(sysdep_dir)
# Get the values defined by options to `configure'. # Get the values defined by options to `configure'.
include $(common-objpfx)config.make 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 $(common-objpfx)config.make: $(common-objpfx)config.status $(..)config.h.in
cd $(<D); $(SHELL) $(<F) cd $(<D); $(SHELL) $(<F)
sysdep-configures = \
# Find all the sysdeps configure fragments, to make sure we re-run # Find all the sysdeps configure fragments, to make sure we re-run
# configure when any of them changes. # configure when any of them changes.
sysdep-configures = \ $(common-objpfx)config.status: $(..)configure \
$(foreach dir,$(config-sysdirs),\ $(foreach dir,$(config-sysdirs),\
$(patsubst %.in,%,\ $(patsubst %.in,%,\
$(firstword $(wildcard \ $(firstword $(wildcard \
$(sysdep_dir)/$(dir)/configure \ $(addprefix $(sysdep_dir)/$(dir)/,configure configure.in Implies)))))
$(sysdep_dir)/$(dir)/configure.in))))
# Force the user to configure before making.
$(common-objpfx)config.status: $(..)configure $(sysdep-configures)
@cd $(@D); if test -f $(@F); then exec $(SHELL) $(@F) --recheck; else \ @cd $(@D); if test -f $(@F); then exec $(SHELL) $(@F) --recheck; else \
echo The GNU C library has not been configured. >&2; \ echo The GNU C library has not been configured. >&2; \
echo Run \`configure\' to configure it before building. >&2; \ echo Run \`configure\' to configure it before building. >&2; \
@ -112,9 +114,6 @@ ifneq ($(wildcard $(objpfx)configparms),)
include $(objpfx)configparms include $(objpfx)configparms
endif endif
endif endif
sysdep_dir := $(..)sysdeps
export sysdep_dir := $(sysdep_dir)
#### ####
#### These are the configuration variables. You can define values for #### These are the configuration variables. You can define values for

View File

@ -118,8 +118,9 @@ changequote([,])dnl
AC_SUBST(base_machine) AC_SUBST(base_machine)
# Compute the list of sysdep directories for this configuration. # Compute the list of sysdep directories for this configuration.
# This can take a while to compute.
sysdep_dir=$srcdir/sysdeps 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. dnl We need to use [ and ] for other purposes for a while now.
changequote(,)dnl changequote(,)dnl
# Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1. # 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 # Expand the list of system names into a full list of directories
# from each element's parent name and Implies file (if present). # from each element's parent name and Implies file (if present).
set $sysnames set $sysnames
names= seen=
while test $# -gt 0; do while test $# -gt 0; do
name=$1 name=$1
shift 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 if test -f $sysdep_dir/$name/Implies; then
# Collect more names from the `Implies' file (removing comments). # Collect more names from the `Implies' file (removing comments).
implied="`sed 's/#.*$//' < $sysdep_dir/$name/Implies`" implied="`sed 's/#.*$//' < $sysdep_dir/$name/Implies`"
for x in $implied; do 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 done
else else
implied= implied=
@ -248,6 +260,9 @@ while test $# -gt 0; do
# Add NAME to the list of names. # Add NAME to the list of names.
names="$names $name" 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. # Find the parent of NAME, using the empty string if it has none.
changequote(,)dnl changequote(,)dnl
@ -266,28 +281,13 @@ changequote([,])dnl
done done
# Add the default directories. # 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= ### Locate tools.
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"
AC_PROG_INSTALL AC_PROG_INSTALL
if test "$INSTALL" = "${srcdir}/install-sh"; then if test "$INSTALL" = "${srcdir}/install-sh"; then

View File

@ -99,7 +99,7 @@ ifneq (ld.so, $(rtld-installed-name))
# against it. # against it.
$(objpfx)$(rtld-installed-name): $(objpfx)ld.so $(objpfx)$(rtld-installed-name): $(objpfx)ld.so
rm -f $@ rm -f $@
ln $< $@ ln -s $(<F) $@
endif endif
# The Linux-compatible dynamic linker shared object is just the same # The Linux-compatible dynamic linker shared object is just the same

View File

@ -32,6 +32,13 @@ _dl_open (struct link_map *parent, const char *file, int mode)
struct r_debug *r; 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. */ /* Load the named object. */
new = _dl_map_object (parent, file, lt_loaded); new = _dl_map_object (parent, file, lt_loaded);
if (new->l_searchlist) if (new->l_searchlist)

View File

@ -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. */ /* Load all the libraries specified by DT_NEEDED entries. */
_dl_map_object_deps (l); _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 /* XXX if kept, move it so l_next list is in dep order because
it will determine gdb's search order. it will determine gdb's search order.
Perhaps do this always, so later dlopen by name finds it? Perhaps do this always, so later dlopen by name finds it?

View File

@ -213,6 +213,8 @@ _dl_sysdep_start_cleanup (void)
int int
_dl_sysdep_open_zero_fill (void) _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; return (int) MACH_PORT_NULL;
} }

View File

@ -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, not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */ Cambridge, MA 02139, USA. */
#include <stdio.h>
#include "version.h" #include "version.h"
const char __libc_release[] = RELEASE; const char __libc_release[] = RELEASE;
const char __libc_version[] = VERSION; const char __libc_version[] = VERSION;
void static const char banner[] =
__libc_print_version (void) "GNU C Library "RELEASE" release version "VERSION", by Roland McGrath et al.\n\
{ Compiled by GNU CC version "__VERSION__".\n\
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 ("\
Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.\n\ Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions.\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\ 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 #ifdef HAVE_ELF
/* This function is the entry point for the shared object. /* This function is the entry point for the shared object.
Running the library as a program will get here. */ Running the library as a program will get here. */
#include <stdlib.h>
void void
__libc_main (void) __libc_main (void)
{ {
__libc_print_version (); __libc_print_version ();
exit (0); _exit (0);
} }
#endif #endif