2001-09-18  Ulrich Drepper  <drepper@redhat.com>

	* malloc/malloc.c (ptmalloc_init): Handle _environ==NULL.
	Reported by B. D. Elliott <bde@nwlink.com> [PR libc/2541].

2001-09-18  Andreas Schwab  <schwab@suse.de>

	* elf/dl-load.c (_dl_map_object_from_fd): Update handling of scope
	list, now that l_scope is a pointer.

	* elf/dl-open.c (dl_open_worker): Fix thinko when enlarging the
	scope list.

2001-09-18  kaz Kojima  <kkojima@rr.iij4u.or.jp>

	* sysdeps/sh/dl-machine.h (elf_machine_rela): Fix reverse condition.
	(elf_machine_rela_relative): Add a missing declaration.

2001-09-18  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed: New.
	* sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed: New.
	* sysdeps/unix/sysv/linux/configure.in: Add ia64 and s390
	ldd-rewrite scripts.

2001-09-18  Ulrich Drepper  <drepper@redhat.com>

	* elf/ldd.bash.in: Update copyright message.

2001-09-17  H.J. Lu  <hjl@gnu.org>

	* hurd/hurdmalloc.c (bcopy): Removed.
	(realloc): Replace bcopy with memcpy.
	* hurd/path-lookup.c (file_name_path_scan): Likewise.
	* resolv/gethnamaddr.c (map_v4v6_address): Likewise.
	* sunrpc/rpcinfo.c (pmapdump): Likewise.

	* resolv/gethnamaddr.c (getanswer): Replace bcopy with memmove.
	(gethostbyaddr): Likewise.
	* sunrpc/rpcinfo.c (get_inet_address): Likewise.

2001-09-18  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/gnu/eval.c: Removed.
This commit is contained in:
Ulrich Drepper 2001-09-19 03:25:37 +00:00
parent 013ed6739f
commit 9596d0ddf0
14 changed files with 124 additions and 61 deletions

View File

@ -1,3 +1,48 @@
2001-09-18 Ulrich Drepper <drepper@redhat.com>
* malloc/malloc.c (ptmalloc_init): Handle _environ==NULL.
Reported by B. D. Elliott <bde@nwlink.com> [PR libc/2541].
2001-09-18 Andreas Schwab <schwab@suse.de>
* elf/dl-load.c (_dl_map_object_from_fd): Update handling of scope
list, now that l_scope is a pointer.
* elf/dl-open.c (dl_open_worker): Fix thinko when enlarging the
scope list.
2001-09-18 kaz Kojima <kkojima@rr.iij4u.or.jp>
* sysdeps/sh/dl-machine.h (elf_machine_rela): Fix reverse condition.
(elf_machine_rela_relative): Add a missing declaration.
2001-09-18 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed: New.
* sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed: New.
* sysdeps/unix/sysv/linux/configure.in: Add ia64 and s390
ldd-rewrite scripts.
2001-09-18 Ulrich Drepper <drepper@redhat.com>
* elf/ldd.bash.in: Update copyright message.
2001-09-17 H.J. Lu <hjl@gnu.org>
* hurd/hurdmalloc.c (bcopy): Removed.
(realloc): Replace bcopy with memcpy.
* hurd/path-lookup.c (file_name_path_scan): Likewise.
* resolv/gethnamaddr.c (map_v4v6_address): Likewise.
* sunrpc/rpcinfo.c (pmapdump): Likewise.
* resolv/gethnamaddr.c (getanswer): Replace bcopy with memmove.
(gethostbyaddr): Likewise.
* sunrpc/rpcinfo.c (get_inet_address): Likewise.
2001-09-18 Ulrich Drepper <drepper@redhat.com>
* sysdeps/gnu/eval.c: Removed.
2001-09-18 Andreas Jaeger <aj@suse.de>
* sysdeps/i386/fpu/s_logbl.S: Move to ...

View File

@ -1136,7 +1136,7 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
/* Now move the existing entries one back. */
memmove (&l->l_scope[1], &l->l_scope[0],
sizeof (l->l_scope) - sizeof (l->l_scope[0]));
(l->l_scope_max - 1) * sizeof (l->l_scope[0]));
/* Now add the new entry. */
l->l_scope[0] = &l->l_symbolic_searchlist;

View File

@ -312,7 +312,7 @@ dl_open_worker (void *a)
++runp;
}
if (__builtin_expect (cnt + 1 < imap->l_scope_max, 0))
if (__builtin_expect (cnt + 1 >= imap->l_scope_max, 0))
{
/* The 'r_scope' array is too small. Allocate a new one
dynamically. */
@ -327,7 +327,7 @@ dl_open_worker (void *a)
_dl_signal_error (ENOMEM, "dlopen", NULL,
N_("cannot create scope list"));
imap->l_scope = memcpy (newp, imap->l_scope,
cnt * imap->l_scope_max);
cnt * sizeof (imap->l_scope[0]));
}
else
{
@ -339,10 +339,10 @@ dl_open_worker (void *a)
N_("cannot create scope list"));
imap->l_scope = newp;
}
imap->l_scope[cnt++] = &new->l_searchlist;
imap->l_scope[cnt] = NULL;
}
imap->l_scope[cnt++] = &new->l_searchlist;
imap->l_scope[cnt] = NULL;
}
/* Run the initializer functions of new objects. */

View File

@ -36,7 +36,7 @@ while test $# -gt 0; do
case "$1" in
--vers | --versi | --versio | --version)
echo 'ldd (GNU libc) @VERSION@'
echo $"Copyright (C) 1999 Free Software Foundation, Inc.
echo $"Copyright (C) 2001 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper."

View File

@ -1,8 +1,6 @@
#include <stdlib.h>
#include <string.h>
#define bcopy(s,d,n) memcpy ((d), (s), (n)) /* No overlap handling. */
#include "hurdmalloc.h" /* XXX see that file */
#include <mach.h>
@ -37,6 +35,10 @@
/*
* HISTORY
* $Log$
* Revision 1.15 2001/09/19 03:04:09 drepper
* (bcopy): Removed.
* (realloc): Replace bcopy with memcpy.
*
* Revision 1.14 2001/04/01 05:03:14 roland
* 2001-03-11 Roland McGrath <roland@frob.com>
*
@ -422,8 +424,8 @@ realloc(old_base, new_size)
*/
new_base = malloc(new_size);
if (new_base)
bcopy(old_base, new_base,
(int) (old_size < new_size ? old_size : new_size));
memcpy (new_base, old_base,
(int) (old_size < new_size ? old_size : new_size));
if (new_base || new_size == 0)
/* Free OLD_BASE, but only if the malloc didn't fail. */

View File

@ -55,10 +55,10 @@ file_name_path_scan (const char *file_name, const char *path,
if (pfx_len == 0)
pfxed_name[pfx_len++] = '.';
else
bcopy (path, pfxed_name, pfx_len);
memcpy (pfxed_name, path, pfx_len);
if (pfxed_name[pfx_len - 1] != '/')
pfxed_name[pfx_len++] = '/';
bcopy (file_name, pfxed_name + pfx_len, file_name_len + 1);
memcpy (pfxed_name + pfx_len, file_name, file_name_len + 1);
err = (*fun)(pfxed_name);
if (err == 0)

View File

@ -1766,49 +1766,49 @@ ptmalloc_init __MALLOC_P((void))
secure = __libc_enable_secure;
#ifdef _LIBC
s = NULL;
{
char **runp = _environ;
char *envline;
if (_environ != NULL)
{
char **runp = _environ;
char *envline;
while (__builtin_expect ((envline = next_env_entry (&runp)) != NULL,
0))
{
size_t len = strcspn (envline, "=");
while (__builtin_expect ((envline = next_env_entry (&runp)) != NULL, 0))
{
size_t len = strcspn (envline, "=");
if (envline[len] != '=')
/* This is a "MALLOC_" variable at the end of the string
without a '=' character. Ignore it since otherwise we
will access invalid memory below. */
continue;
if (envline[len] != '=')
/* This is a "MALLOC_" variable at the end of the string
without a '=' character. Ignore it since otherwise we
will access invalid memory below. */
continue;
switch (len)
{
case 6:
if (memcmp (envline, "CHECK_", 6) == 0)
s = &envline[7];
break;
case 8:
if (! secure && memcmp (envline, "TOP_PAD_", 8) == 0)
mALLOPt(M_TOP_PAD, atoi(&envline[9]));
break;
case 9:
if (! secure && memcmp (envline, "MMAP_MAX_", 9) == 0)
mALLOPt(M_MMAP_MAX, atoi(&envline[10]));
break;
case 15:
if (! secure)
{
if (memcmp (envline, "TRIM_THRESHOLD_", 15) == 0)
mALLOPt(M_TRIM_THRESHOLD, atoi(&envline[16]));
else if (memcmp (envline, "MMAP_THRESHOLD_", 15) == 0)
mALLOPt(M_MMAP_THRESHOLD, atoi(&envline[16]));
}
break;
default:
break;
}
}
}
switch (len)
{
case 6:
if (memcmp (envline, "CHECK_", 6) == 0)
s = &envline[7];
break;
case 8:
if (! secure && memcmp (envline, "TOP_PAD_", 8) == 0)
mALLOPt(M_TOP_PAD, atoi(&envline[9]));
break;
case 9:
if (! secure && memcmp (envline, "MMAP_MAX_", 9) == 0)
mALLOPt(M_MMAP_MAX, atoi(&envline[10]));
break;
case 15:
if (! secure)
{
if (memcmp (envline, "TRIM_THRESHOLD_", 15) == 0)
mALLOPt(M_TRIM_THRESHOLD, atoi(&envline[16]));
else if (memcmp (envline, "MMAP_THRESHOLD_", 15) == 0)
mALLOPt(M_MMAP_THRESHOLD, atoi(&envline[16]));
}
break;
default:
break;
}
}
}
#else
if (! secure)
{

View File

@ -441,7 +441,7 @@ getanswer(answer, anslen, qname, qtype)
cp += n;
continue;
}
bcopy(cp, *hap++ = bp, n);
memmove(*hap++ = bp, cp, n);
bp += n;
buflen -= n;
cp += n;
@ -738,7 +738,7 @@ gethostbyaddr(addr, len, af)
#endif /*SUNSECURITY*/
hp->h_addrtype = af;
hp->h_length = len;
bcopy(addr, host_addr, len);
memmove(host_addr, addr, len);
h_addr_ptrs[0] = (char *)host_addr;
h_addr_ptrs[1] = NULL;
if (af == AF_INET && (_res.options & RES_USE_INET6)) {
@ -899,14 +899,14 @@ map_v4v6_address(src, dst)
int i;
/* Stash a temporary copy so our caller can update in place. */
bcopy(src, tmp, INADDRSZ);
memcpy(tmp, src, INADDRSZ);
/* Mark this ipv6 addr as a mapped ipv4. */
for (i = 0; i < 10; i++)
*p++ = 0x00;
*p++ = 0xff;
*p++ = 0xff;
/* Retrieve the saved copy and we're done. */
bcopy(tmp, (void*)p, INADDRSZ);
memcpy((void*)p, tmp, INADDRSZ);
}
static void

View File

@ -542,8 +542,8 @@ pmapdump (argc, argv)
bzero ((char *) &server_addr, sizeof server_addr);
server_addr.sin_family = AF_INET;
if ((hp = gethostbyname ("localhost")) != NULL)
bcopy (hp->h_addr, (caddr_t) & server_addr.sin_addr,
hp->h_length);
memcpy ((caddr_t) & server_addr.sin_addr, hp->h_addr,
hp->h_length);
else
server_addr.sin_addr.s_addr = inet_addr ("0.0.0.0");
}
@ -733,7 +733,7 @@ get_inet_address (addr, host)
host);
exit (1);
}
bcopy (hp->h_addr, (char *) &addr->sin_addr, hp->h_length);
memmove ((char *) &addr->sin_addr, hp->h_addr, hp->h_length);
}
addr->sin_family = AF_INET;
}

View File

@ -487,7 +487,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
}
}
#ifndef RTLD_BOOTSTRAP
else if (__builtin_expect (r_type != R_SH_NONE, 0))
else if (__builtin_expect (r_type == R_SH_NONE, 0))
return;
#endif
else
@ -561,6 +561,8 @@ static inline void
elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc,
Elf32_Addr *const reloc_addr)
{
Elf32_Addr value;
if (reloc->r_addend)
value = l_addr + reloc->r_addend;
else

View File

@ -189,6 +189,12 @@ case "$machine" in
i[3456]86* | m68*)
ldd_rewrite_script=../sysdeps/unix/sysv/linux/ldd-rewrite.sed
;;
ia64*)
ldd_rewrite_script=../sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed
;;
s390*)
ldd_rewrite_script=../sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
;;
sparc*)
ldd_rewrite_script=../sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
;;

View File

@ -157,6 +157,12 @@ case "$machine" in
i[3456]86* | m68*)
ldd_rewrite_script=../sysdeps/unix/sysv/linux/ldd-rewrite.sed
;;
ia64*)
ldd_rewrite_script=../sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed
;;
s390*)
ldd_rewrite_script=../sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
;;
sparc*)
ldd_rewrite_script=../sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
;;

View File

@ -0,0 +1 @@
s_^\(RTLDLIST=\)\([^ ]*\)\(\|-ia64\)\(\.so\.[0-9.]*\)[ ]*$_\1"\2-ia64\4 \2\4"_

View File

@ -0,0 +1 @@
s_^\(RTLDLIST=\)\([^ ]*\)\(\|64\)\(\.so\.[0-9.]*\)[ ]*$_\1"\2\4 \264\4"_