Tue Jul 23 18:13:37 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>

* sysdeps/mach/hurd/Makefile (rpcuserlibs): New variable.
	($(common-objpfx)libc.so): Move deps into that, use it.
	[$(subdir) = elf] ($(objpfx)librtld.so): Depend on
	$(rpcuserlibs:.so=_pic.a).
	* elf/Makefile ($(objpfx)librtld.so): Just depend on libc_pic.a; don't
	use $(LDLIBS-c.so).

Thu Jul 18 21:41:25 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/generic/stpncpy.c: Fix semantics to make `stpncpy (d, s,
 	n)' equivalent to `strncpy (d, s, n), d += strnlen (d, n)'.
This commit is contained in:
Roland McGrath 1996-07-23 22:18:45 +00:00
parent b24be05f19
commit c7fd2f4783
4 changed files with 39 additions and 19 deletions

View File

@ -1,3 +1,17 @@
Tue Jul 23 18:13:37 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* sysdeps/mach/hurd/Makefile (rpcuserlibs): New variable.
($(common-objpfx)libc.so): Move deps into that, use it.
[$(subdir) = elf] ($(objpfx)librtld.so): Depend on
$(rpcuserlibs:.so=_pic.a).
* elf/Makefile ($(objpfx)librtld.so): Just depend on libc_pic.a; don't
use $(LDLIBS-c.so).
Thu Jul 18 21:41:25 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/generic/stpncpy.c: Fix semantics to make `stpncpy (d, s,
n)' equivalent to `strncpy (d, s, n), d += strnlen (d, n)'.
Tue Jul 23 02:49:58 1996 Ulrich Drepper <drepper@cygnus.com> Tue Jul 23 02:49:58 1996 Ulrich Drepper <drepper@cygnus.com>
* locale/iso-4217.def: Add India to comment for symbol "INR ". * locale/iso-4217.def: Add India to comment for symbol "INR ".

View File

@ -70,9 +70,7 @@ $(objpfx)dl-allobjs.so: $(rtld-routines:%=$(objpfx)%.so)
# Link together the dynamic linker into a single relocatable object. # Link together the dynamic linker into a single relocatable object.
# We use this to produce both the ABI-compliant and Linux-compatible # We use this to produce both the ABI-compliant and Linux-compatible
# dynamic linker shared objects below. # dynamic linker shared objects below.
$(objpfx)librtld.so: $(objpfx)dl-allobjs.so \ $(objpfx)librtld.so: $(objpfx)dl-allobjs.so $(common-objpfx)libc_pic.a
$(patsubst %,$(common-objpfx)lib%_pic.a,\
c $(LDLIBS-c.so:-l%=%))
$(reloc-link) '-Wl,-(' $^ -lgcc '-Wl,-)' $(reloc-link) '-Wl,-(' $^ -lgcc '-Wl,-)'
$(objpfx)ld.so: $(objpfx)librtld.so $(objpfx)ld.so: $(objpfx)librtld.so

View File

@ -24,15 +24,13 @@ Cambridge, MA 02139, USA. */
/* Copy no more than N characters of SRC to DEST, returning the address of /* Copy no more than N characters of SRC to DEST, returning the address of
the last character written into DEST. */ the terminating '\0' in DEST, if any, or else DEST + N. */
char * char *
DEFUN(__stpncpy, (dest, src, n), char *dest AND CONST char *src AND size_t n) DEFUN(__stpncpy, (dest, src, n), char *dest AND CONST char *src AND size_t n)
{ {
reg_char c; reg_char c;
char *s = dest; char *s = dest;
--dest;
if (n >= 4) if (n >= 4)
{ {
size_t n4 = n >> 2; size_t n4 = n >> 2;
@ -40,27 +38,27 @@ DEFUN(__stpncpy, (dest, src, n), char *dest AND CONST char *src AND size_t n)
for (;;) for (;;)
{ {
c = *src++; c = *src++;
*++dest = c; *dest++ = c;
if (c == '\0') if (c == '\0')
break; break;
c = *src++; c = *src++;
*++dest = c; *dest++ = c;
if (c == '\0') if (c == '\0')
break; break;
c = *src++; c = *src++;
*++dest = c; *dest++ = c;
if (c == '\0') if (c == '\0')
break; break;
c = *src++; c = *src++;
*++dest = c; *dest++ = c;
if (c == '\0') if (c == '\0')
break; break;
if (--n4 == 0) if (--n4 == 0)
goto last_chars; goto last_chars;
} }
n = n - (dest - s) - 1; n -= dest - s;
if (n == 0) if (n == 0)
return dest; return dest - 1;
goto zero_fill; goto zero_fill;
} }
@ -69,20 +67,22 @@ DEFUN(__stpncpy, (dest, src, n), char *dest AND CONST char *src AND size_t n)
if (n == 0) if (n == 0)
return dest; return dest;
do for (;;)
{ {
c = *src++; c = *src++;
*++dest = c; *dest++ = c;
if (c == '\0')
break;
if (--n == 0) if (--n == 0)
return dest; return dest;
} }
while (c != '\0'); --n;
zero_fill: zero_fill:
while (n-- > 0) while (--n > 0)
dest[n] = '\0'; dest[n] = '\0';
return dest; return dest - 1;
} }
weak_alias (__stpncpy, stpncpy) weak_alias (__stpncpy, stpncpy)

View File

@ -104,11 +104,19 @@ endif
# For the shared library, we don't need to do the linker script machination. # For the shared library, we don't need to do the linker script machination.
# Instead, we specify the required libraries when building the shared object. # Instead, we specify the required libraries when building the shared object.
$(common-objpfx)libc.so: $(firstword $(objdir) $(..)mach)/libmachuser.so \ rpcuserlibs := $(firstword $(objdir) $(..)mach)/libmachuser.so \
$(firstword $(objdir) $(..)hurd)/libhurduser.so $(firstword $(objdir) $(..)hurd)/libhurduser.so
$(common-objpfx)libc.so: $(rpcuserlibs)
ifndef objpfx ifndef objpfx
rpath-link += $(..)mach:$(..)hurd rpath-link += $(..)mach:$(..)hurd
endif endif
# The RPC stubs from these libraries are needed in building the dynamic
# linker, too. It must be self-contained, so we link the needed PIC
# objects directly into the shared object.
ifeq (elf,$(subdir))
$(objpfx)librtld.so: $(rpcuserlibs:.so=_pic.a)
endif
endif # in-Makerules endif # in-Makerules