1997-05-21 17:50  Ulrich Drepper  <drepper@cygnus.com>

	* elf/Makefile (dl-routines): Add dl-sysdepio.
	* elf/dl-support.c (_dl_sysdep_fatal): Removed.
	* sysdeps/generic/dl-sysdep.c: Move definition of _dl_sysdep_fatal,
	_dl_sysdep_error and _dl_sysdep_warning to ...
	* sysdeps/generic/dl-sysdepio.c: ...here.
	* sysdeps/mach/hurd/dl-sysdep.c: Move the functions to ...
	* sysdeps/mach/hurd/dl-sysdepio.c: ...here.
	* sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c: Remove definition
	of functions.
	Bug reported by Marcus G. Daniels <marcus@cathcart.sysc.pdx.edu>.

	* db/Makefile (libdb.so): Depend on libc.so for dynamic loading
	and for Linux ld.so.
	* login/Makefile (libutil.so): Likewise.
	* math/Makefile (libm.so): Likewise.
	* md5-crypt/Makefile (libcrypt.so): Likewise.
	* nis/Makefile (libnss_%.so): Likewise.
	* resolv/Makefile (libnss_dns.so): Likewise.

1997-05-20 14:01  Miles Bader  <miles@gnu.ai.mit.edu>

	* argp-help.c (_help): Supply STATE to argp_args_usage.
	(argp_args_usage): Add filtering of the args doc string.
	(comma): Print cluster headers for the first entry too.
	* argp.h (ARGP_KEY_HELP_ARGS_DOC): New macro.

	Patches by Jean-Franois Bignolles <bignolle@ecoledoc.ibp.fr>.
	Include <config.h> if HAVE_CONFIG_H is defined.
	* sunrpc/xdr_float.c: Likewise.
This commit is contained in:
Ulrich Drepper 1997-05-21 16:03:22 +00:00
parent 1f205a479b
commit 9498096c93
16 changed files with 254 additions and 150 deletions

View File

@ -1,3 +1,31 @@
1997-05-21 17:50 Ulrich Drepper <drepper@cygnus.com>
* elf/Makefile (dl-routines): Add dl-sysdepio.
* elf/dl-support.c (_dl_sysdep_fatal): Removed.
* sysdeps/generic/dl-sysdep.c: Move definition of _dl_sysdep_fatal,
_dl_sysdep_error and _dl_sysdep_warning to ...
* sysdeps/generic/dl-sysdepio.c: ...here.
* sysdeps/mach/hurd/dl-sysdep.c: Move the functions to ...
* sysdeps/mach/hurd/dl-sysdepio.c: ...here.
* sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c: Remove definition
of functions.
Bug reported by Marcus G. Daniels <marcus@cathcart.sysc.pdx.edu>.
* db/Makefile (libdb.so): Depend on libc.so for dynamic loading
and for Linux ld.so.
* login/Makefile (libutil.so): Likewise.
* math/Makefile (libm.so): Likewise.
* md5-crypt/Makefile (libcrypt.so): Likewise.
* nis/Makefile (libnss_%.so): Likewise.
* resolv/Makefile (libnss_dns.so): Likewise.
1997-05-20 14:01 Miles Bader <miles@gnu.ai.mit.edu>
* argp-help.c (_help): Supply STATE to argp_args_usage.
(argp_args_usage): Add filtering of the args doc string.
(comma): Print cluster headers for the first entry too.
* argp.h (ARGP_KEY_HELP_ARGS_DOC): New macro.
1997-05-21 02:49 Ulrich Drepper <drepper@cygnus.com>
* gnu-versions.h (_GNU_OBSTACK_INTERFACE_VERSION): Set to 2 since
@ -20,6 +48,7 @@
* string/tst-svc.c: New file. Test for strverscmp.
* string/tst-svc.input: New file. Input data for tst-svc.
* string/tst-svc.expect: New file. Expected out from tst-svc.
Patches by Jean-François Bignolles <bignolle@ecoledoc.ibp.fr>.
* math/Makefile (calls): Add s_signbit.
@ -29,7 +58,7 @@
* sunrpc/pmap_rmt.c: Likewise.
* string/basename.c: Don't use ISO C definition style.
Include <config.h> is HAVE_CONFIG_H is defined.
Include <config.h> if HAVE_CONFIG_H is defined.
* sunrpc/proto.h: Add `const' wherever possible.
* sunrpc/rpc_cout.c: Likewise.
@ -39,7 +68,7 @@
* sunrpc/xdr_stdio.c: Likewise.
* sunrpc/rpc_parse.c: Delete comma from end of enum definition.
* sunrpc/xdr.c: Little code cleanups.
* sunrpc/xdr_flaot.c: Likewise.
* sunrpc/xdr_float.c: Likewise.
Patches by Matthew Wilcox <matthew.wilcox@chbs.mhs.ciba.com>.
* sysdeps/i386/fpu/__math.h (__finite): Fix typo.

View File

@ -973,8 +973,10 @@ comma (unsigned col, struct pentry_state *pest)
if (pest->hhstate->sep_groups && pe && pest->entry->group != pe->group)
__argp_fmtstream_putc (pest->stream, '\n');
if (pe && cl && pe->cluster != cl && cl->header && *cl->header
&& !hol_cluster_is_child (pe->cluster, cl))
if (cl && cl->header && *cl->header
&& (!pe
|| (pe->cluster != cl
&& !hol_cluster_is_child (pe->cluster, cl))))
/* If we're changing clusters, then this must be the start of the
ENTRY's cluster unless that is an ancestor of the previous one
(in which case we had just popped into a sub-cluster for a bit).
@ -1305,17 +1307,19 @@ argp_args_levels (const struct argp *argp)
updated by this routine for the next call if ADVANCE is true. True is
returned as long as there are more patterns to output. */
static int
argp_args_usage (const struct argp *argp, char **levels, int advance,
argp_fmtstream_t stream)
argp_args_usage (const struct argp *argp, const struct argp_state *state,
char **levels, int advance, argp_fmtstream_t stream)
{
char *our_level = *levels;
int multiple = 0;
const struct argp_child *child = argp->children;
const char *doc = gettext (argp->args_doc), *nl = 0;
const char *tdoc = gettext (argp->args_doc), *nl = 0;
const char *fdoc = filter_doc (tdoc, ARGP_KEY_HELP_ARGS_DOC,
state ? state->argp : 0, state);
if (doc)
if (fdoc)
{
nl = strchr (doc, '\n');
nl = strchr (fdoc, '\n');
if (nl)
/* This is a `multi-level' args doc; advance to the correct position
as determined by our state in LEVELS, and update LEVELS. */
@ -1323,22 +1327,24 @@ argp_args_usage (const struct argp *argp, char **levels, int advance,
int i;
multiple = 1;
for (i = 0; i < *our_level; i++)
doc = nl + 1, nl = strchr (doc, '\n');
fdoc = nl + 1, nl = strchr (fdoc, '\n');
(*levels)++;
}
if (! nl)
nl = doc + strlen (doc);
nl = fdoc + strlen (fdoc);
/* Manually do line wrapping so that it (probably) won't get wrapped at
any embedded spaces. */
space (stream, 1 + nl - doc);
space (stream, 1 + nl - fdoc);
__argp_fmtstream_write (stream, doc, nl - doc);
__argp_fmtstream_write (stream, fdoc, nl - fdoc);
}
if (fdoc && fdoc != tdoc)
free ((char *)fdoc); /* Free user's modified doc string. */
if (child)
while (child->argp)
advance = !argp_args_usage ((child++)->argp, levels, advance, stream);
advance = !argp_args_usage ((child++)->argp, state, levels, advance, stream);
if (advance && multiple)
/* Need to increment our level. */
@ -1517,7 +1523,7 @@ _help (const struct argp *argp, const struct argp_state *state, FILE *stream,
flags |= ARGP_HELP_SHORT_USAGE; /* But only do so once. */
}
more_patterns = argp_args_usage (argp, &levels, 1, fs);
more_patterns = argp_args_usage (argp, state, &levels, 1, fs);
__argp_fmtstream_set_wmargin (fs, old_wm);
__argp_fmtstream_set_lmargin (fs, old_lm);

View File

@ -242,6 +242,7 @@ struct argp
/* Explanatory note emitted when duplicate option arguments have been
suppressed. */
#define ARGP_KEY_HELP_DUP_ARGS_NOTE 0x2000005
#define ARGP_KEY_HELP_ARGS_DOC 0x2000006 /* Argument doc string. */
/* When an argp has a non-zero CHILDREN field, it should point to a vector of
argp_child structures, each of which describes a subsidiary argp. */

View File

@ -45,3 +45,8 @@ $(objpfx)makedb: $(objpfx)libdb.so$(libdb.so-version)
else
$(objpfx)makedb: $(objpfx)libdb.a
endif
# Depend on libc.so so a DT_NEEDED is generated in the shared objects.
# This ensures they will load libc.so for needed symbols if loaded by
# a statically-linked program that hasn't already loaded it.
$(objpfx)libdb.so: $(common-objpfx)libc.so

View File

@ -27,7 +27,7 @@ routines = $(dl-routines) dl-open dl-close dl-symbol dl-support \
# The core dynamic linking functions are in libc for the static and
# profiled libraries.
dl-routines = $(addprefix dl-,load cache lookup object reloc deps \
runtime error init fini debug)
runtime error init fini debug sysdepio)
# But they are absent from the shared libc, because that code is in ld.so.
elide-routines.so = $(dl-routines) dl-support enbl-secure

View File

@ -44,13 +44,6 @@ _dl_sysdep_open_zero_fill (void)
}
#endif
/* This should never be called. */
void
_dl_sysdep_fatal (void)
{
assert (! "_dl_sysdep_fatal called");
}
/* Read the whole contents of FILE into new mmap'd space with given
protections. *SIZEP gets the size of the file. */

View File

@ -1,4 +1,4 @@
# Copyright (C) 1996 Free Software Foundation, Inc.
# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@ -35,5 +35,9 @@ extra-libs-others := $(extra-libs)
libutil-routines:= login login_tty logout logwtmp pty
include ../Rules
# Depend on libc.so so a DT_NEEDED is generated in the shared objects.
# This ensures they will load libc.so for needed symbols if loaded by
# a statically-linked program that hasn't already loaded it.
$(objpfx)libutil.so: $(common-objpfx)libc.so

View File

@ -133,3 +133,8 @@ $(addprefix $(objpfx),$(tests)): $(objpfx)libm.so$(libm.so-version)
else
$(addprefix $(objpfx),$(tests)): $(objpfx)libm.a
endif
# Depend on libc.so so a DT_NEEDED is generated in the shared objects.
# This ensures they will load libc.so for needed symbols if loaded by
# a statically-linked program that hasn't already loaded it.
$(objpfx)libm.so: $(common-objpfx)libc.so

View File

@ -64,3 +64,8 @@ $(objpfx)$(patsubst %,$(libtype$o),md5crypt): \
endef
object-suffixes-left = $(object-suffixes)
include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes))
# Depend on libc.so so a DT_NEEDED is generated in the shared objects.
# This ensures they will load libc.so for needed symbols if loaded by
# a statically-linked program that hasn't already loaded it.
$(objpfx)libcrypt.so: $(common-objpfx)libc.so

View File

@ -73,7 +73,7 @@ $(objpfx)libnss_nisplus.so: $(objpfx)libnsl.so$(libnsl.so-version)
# Depend on libc.so so a DT_NEEDED is generated in the shared objects.
# This ensures they will load libc.so for needed symbols if loaded by
# a statically-linked program that hasn't already loaded it.
$(services:%=$(objpfx)libnss_%.so): $(common-objpfx)libc.so
$(services:%=$(objpfx)libnss_%.so) $(objpfx)libnsl.so: $(common-objpfx)libc.so
ifeq ($(build-shared),yes)

View File

@ -56,4 +56,4 @@ CPPFLAGS += -Dgethostbyname=res_gethostbyname \
$(objpfx)libresolv.so: $(common-objpfx)libc.so
# The DNS NSS modules needs the resolver.
$(objpfx)libnss_dns.so: $(objpfx)libresolv.so
$(objpfx)libnss_dns.so: $(objpfx)libresolv.so $(common-objpfx)libc.so

View File

@ -24,8 +24,6 @@
#include <fcntl.h>
#include <link.h>
#include <unistd.h>
#include <stdarg.h>
#include <string.h>
extern int _dl_argc;
@ -177,52 +175,3 @@ _dl_sysdep_read_whole_file (const char *file, size_t *sizep, int prot)
__close (fd);
return result;
}
void
_dl_sysdep_fatal (const char *msg, ...)
{
va_list ap;
va_start (ap, msg);
do
{
size_t len = strlen (msg);
__write (STDERR_FILENO, msg, len);
msg = va_arg (ap, const char *);
} while (msg);
va_end (ap);
_exit (127);
}
void
_dl_sysdep_error (const char *msg, ...)
{
va_list ap;
va_start (ap, msg);
do
{
size_t len = strlen (msg);
__write (STDERR_FILENO, msg, len);
msg = va_arg (ap, const char *);
} while (msg);
va_end (ap);
}
void
_dl_sysdep_message (const char *msg, ...)
{
va_list ap;
va_start (ap, msg);
do
{
size_t len = strlen (msg);
__write (STDOUT_FILENO, msg, len);
msg = va_arg (ap, const char *);
} while (msg);
va_end (ap);
}

View File

@ -0,0 +1,72 @@
/* Operating I/O support for run-time dynamic linker. Generic Unix version.
Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <unistd.h>
#include <stdarg.h>
#include <string.h>
void
_dl_sysdep_fatal (const char *msg, ...)
{
va_list ap;
va_start (ap, msg);
do
{
size_t len = strlen (msg);
__write (STDERR_FILENO, msg, len);
msg = va_arg (ap, const char *);
} while (msg);
va_end (ap);
_exit (127);
}
void
_dl_sysdep_error (const char *msg, ...)
{
va_list ap;
va_start (ap, msg);
do
{
size_t len = strlen (msg);
__write (STDERR_FILENO, msg, len);
msg = va_arg (ap, const char *);
} while (msg);
va_end (ap);
}
void
_dl_sysdep_message (const char *msg, ...)
{
va_list ap;
va_start (ap, msg);
do
{
size_t len = strlen (msg);
__write (STDOUT_FILENO, msg, len);
msg = va_arg (ap, const char *);
} while (msg);
va_end (ap);
}

View File

@ -209,76 +209,6 @@ _dl_sysdep_start_cleanup (void)
__mach_port_deallocate (__mach_task_self (), __mach_task_self_);
}
void
_dl_sysdep_fatal (const char *msg, ...)
{
va_list ap;
va_start (ap, msg);
do
{
size_t len = strlen (msg);
mach_msg_type_number_t nwrote;
do
{
if (__io_write (_hurd_init_dtable[2], msg, len, -1, &nwrote))
break;
len -= nwrote;
msg += nwrote;
} while (nwrote > 0);
msg = va_arg (ap, const char *);
} while (msg);
va_end (ap);
_exit (127);
}
void
_dl_sysdep_error (const char *msg, ...)
{
va_list ap;
va_start (ap, msg);
do
{
size_t len = strlen (msg);
mach_msg_type_number_t nwrote;
do
{
if (__io_write (_hurd_init_dtable[2], msg, len, -1, &nwrote))
break;
len -= nwrote;
msg += nwrote;
} while (nwrote > 0);
msg = va_arg (ap, const char *);
} while (msg);
va_end (ap);
}
void
_dl_sysdep_message (const char *msg, ...)
{
va_list ap;
va_start (ap, msg);
do
{
size_t len = strlen (msg);
mach_msg_type_number_t nwrote;
do
{
if (__io_write (_hurd_init_dtable[1], msg, len, -1, &nwrote))
break;
len -= nwrote;
msg += nwrote;
} while (nwrote > 0);
msg = va_arg (ap, const char *);
} while (msg);
va_end (ap);
}
/* Minimal open/close/mmap implementation sufficient for initial loading of
shared libraries. These are weak definitions so that when the
dynamic linker re-relocates itself to be user-visible (for -ldl),

View File

@ -0,0 +1,107 @@
/* Operating system support for run-time dynamic linker. Hurd version.
Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <hurd.h>
#include <link.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <sys/wait.h>
#include <assert.h>
#include <sysdep.h>
#include <mach/mig_support.h>
#include "hurdstartup.h"
#include <mach/host_info.h>
#include "../stdio-common/_itoa.h"
#include <hurd/auth.h>
#include <hurd/term.h>
#include <stdarg.h>
#include <ctype.h>
#include <sys/stat.h>
void
_dl_sysdep_fatal (const char *msg, ...)
{
va_list ap;
va_start (ap, msg);
do
{
size_t len = strlen (msg);
mach_msg_type_number_t nwrote;
do
{
if (__io_write (_hurd_init_dtable[2], msg, len, -1, &nwrote))
break;
len -= nwrote;
msg += nwrote;
} while (nwrote > 0);
msg = va_arg (ap, const char *);
} while (msg);
va_end (ap);
_exit (127);
}
void
_dl_sysdep_error (const char *msg, ...)
{
va_list ap;
va_start (ap, msg);
do
{
size_t len = strlen (msg);
mach_msg_type_number_t nwrote;
do
{
if (__io_write (_hurd_init_dtable[2], msg, len, -1, &nwrote))
break;
len -= nwrote;
msg += nwrote;
} while (nwrote > 0);
msg = va_arg (ap, const char *);
} while (msg);
va_end (ap);
}
void
_dl_sysdep_message (const char *msg, ...)
{
va_list ap;
va_start (ap, msg);
do
{
size_t len = strlen (msg);
mach_msg_type_number_t nwrote;
do
{
if (__io_write (_hurd_init_dtable[1], msg, len, -1, &nwrote))
break;
len -= nwrote;
msg += nwrote;
} while (nwrote > 0);
msg = va_arg (ap, const char *);
} while (msg);
va_end (ap);
}

View File

@ -24,8 +24,6 @@
#include <fcntl.h>
#include <link.h>
#include <unistd.h>
#include <stdarg.h>
#include <string.h>
extern int _dl_argc;