--- glibc-2.2.4-cygnus/ChangeLog 2001/09/03 12:28:18 1.1.1.109 +++ glibc-2.2.4-redhat/ChangeLog 2001/09/04 18:50:03 1.130 @@ -1,3 +1,13 @@ +2001-09-04 Jakub Jelinek + + * iconv/strtab.c (strtabinit): Initialize null Strent. + (newstring): Move len == 0 handling... + (strtabadd): ...here. + If len == 1, return null Strent. + When inserting a suffix of an existing string, check if + it is not equal to some suffix already recorded. + Copy left and right members over if adding longer string. + 2001-09-02 Ulrich Drepper * elf/rtld.c (dl_main): Increment l_opencount for main binary. --- glibc-2.2.4-cygnus/ChangeLog.11 2000/11/14 18:05:52 1.1.1.1 +++ glibc-2.2.4-redhat/ChangeLog.11 2000/11/18 00:20:10 1.3 @@ -1352,6 +1352,11 @@ * sysdeps/unix/sysv/linux/mips/sys/tas.h: Add missing .mips0 at the end of inline assembler code. +2000-10-02 Jakub Jelinek + + * sunrpc/svc_udp.c (svcudp_recv): Set msg_controllen to all + remaining xp_pad space. + 2000-10-02 Ulrich Drepper * include/features.h [__USE_FILE_OFFSET && !__REDIRECT]: Define @@ -7786,6 +7791,13 @@ * sysdeps/i386/i586/mul_1.S: Likewise. * sysdeps/i386/i586/submul_1.S: Likewise. +2000-06-26 Jakub Jelinek + + * nis/Versions (xdr_ypall): Export in both GLIBC_2.1.2 and GLIBC_2.2 + for Red Hat compatibility. + * nis/yp_xdr.c: Likewise. + * Versions.def (libnsl): Add GLIBC_2.1.2 tag. + 2000-06-25 Greg McGary * sysdeps/i386/i586/memcpy.S: Redefine memcpy as mempcpy, @@ -9280,6 +9292,12 @@ syscall. * sysdeps/unix/sysv/linux/mips/truncate64.c: Likewise. +2000-05-30 Jakub Jelinek + + * resolv/res_query.c (res_nsearch): Remove unused variable + root_on_list. If dots >= statp->ndots and as is querydomain + fails, keep searching. + 2000-05-30 Ulrich Drepper * sysdeps/unix/sysv/linux/alpha/oldglob.c (__old_glob): Loose __P. @@ -9480,6 +9498,11 @@ * sysdeps/i386/fpu/bits/mathinline.h: Define expm1 inline only if __FAST_MATH__ is defined. +2000-05-22 Jakub Jelinek + + * sysdeps/i386/fpu/bits/mathinline.h (__expm1_code): Avoid using ?: + with omitted middle operand. + 2000-05-22 Andreas Jaeger * math/Makefile: Add -D__FAST_MATH__ to CFLAGS-test-ifloat.c, @@ -9717,6 +9740,11 @@ * manual/arith.texi (Parsing of Integers): Fix typo. Closes PR libc/1744, reported by blp@gnu.org. + +2000-05-17 Jakub Jelinek + + * inet/rcmd.c (rcmd_af): If *ahost cannot be resolved, include + unresolved hostname in the message. 2000-05-17 Jakub Jelinek --- glibc-2.2.4-cygnus/ChangeLog.12 2001/08/16 06:26:18 1.1.1.1 +++ glibc-2.2.4-redhat/ChangeLog.12 2001/08/16 06:55:47 1.2 @@ -7729,6 +7729,13 @@ * Versions.def [ld]: Add GLIBC_2.2.1. +2001-01-10 Jakub Jelinek + + * malloc/memusage.c (me): If not SUID/SGID, allow creating new + $MEMUSAGE_OUTPUT file. + * sysdeps/generic/segfault.c (segfault.c): If not SUID/SGID, allow + creating new $SEGFAULT_OUTPUT_NAME file. + 2001-01-10 H.J. Lu * elf/dl-libc.c (do_dlopen): Call DL_STATIC_INIT for static binaries. @@ -8129,6 +8136,11 @@ * resolv/Versions: Fix bracing. * sysdeps/powerpc/soft-fp/Versions: Likewise. * sysdeps/sparc/sparc64/soft-fp/Versions: Likewise. + +2001-01-02 Jakub Jelinek + + * locale/setlocale.c (setlocale): Don't allocate/free category name + unnecessarily. 2001-01-02 Franz Sirl --- glibc-2.2.4-cygnus/Versions.def 2001/08/22 09:44:44 1.1.1.12 +++ glibc-2.2.4-redhat/Versions.def 2001/09/03 12:55:50 1.10 @@ -39,6 +39,7 @@ libm { libnsl { GLIBC_2.0 GLIBC_2.1 + GLIBC_2.1.2 GLIBC_2.2 } libnss_compat { --- glibc-2.2.4-cygnus/configure 2001/09/01 09:13:27 1.1.1.38 +++ glibc-2.2.4-redhat/configure 2001/09/03 12:55:50 1.10 @@ -1592,7 +1592,7 @@ echo "configure:1592: checking version o ac_prog_version=`$MSGFMT --version 2>&1 | sed -n 's/^.*GNU gettext.* \([0-9]*\.[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; - 0.10.3[6-9]* | 0.10.[4-9][0-9]* | 0.1[1-9]* | 0.[2-9][0-9]* | [1-9].*) + 0.10.3[5-9]* | 0.10.[4-9][0-9]* | 0.1[1-9]* | 0.[2-9][0-9]* | [1-9].*) ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; --- glibc-2.2.4-cygnus/configure.in 2001/09/01 09:13:27 1.1.1.36 +++ glibc-2.2.4-redhat/configure.in 2001/09/03 12:55:50 1.9 @@ -599,7 +599,7 @@ fi AC_CHECK_PROG_VER(MSGFMT, gnumsgfmt gmsgfmt msgfmt, --version, [GNU gettext.* \([0-9]*\.[0-9.]*\)], - [0.10.3[6-9]* | 0.10.[4-9][0-9]* | 0.1[1-9]* | 0.[2-9][0-9]* | [1-9].*], + [0.10.3[5-9]* | 0.10.[4-9][0-9]* | 0.1[1-9]* | 0.[2-9][0-9]* | [1-9].*], MSGFMT=: aux_missing="$aux_missing msgfmt") AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version, [GNU texinfo.* \([0-9][0-9.]*\)], --- glibc-2.2.4-cygnus/elf/Makefile 2001/09/01 09:13:29 1.1.1.33 +++ glibc-2.2.4-redhat/elf/Makefile 2001/09/03 12:55:50 1.10 @@ -29,7 +29,7 @@ routines = $(dl-routines) dl-open dl-clo # profiled libraries. dl-routines = $(addprefix dl-,load cache lookup object reloc deps \ runtime error init fini debug misc \ - version profile) + version profile conflict) all-dl-routines = $(dl-routines) $(sysdep-dl-routines) # But they are absent from the shared libc, because that code is in ld.so. elide-routines.os = $(all-dl-routines) dl-support enbl-secure \ --- glibc-2.2.4-cygnus/elf/dl-conflict.c Thu Aug 24 05:00:32 2000 +++ glibc-2.2.4-redhat/elf/dl-conflict.c Tue Sep 4 15:06:38 2001 @@ -0,0 +1,55 @@ +/* Resolve conflicts against already prelinked libraries. + Copyright (C) 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Jakub Jelinek , 2001. + + 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 +#include +#include +#include +#include +#include +#include +#include "dynamic-link.h" + +extern unsigned long int _dl_num_cache_relocations; /* in dl-lookup.c */ + +void +_dl_resolve_conflicts (struct link_map *l, ElfW(Rela) *conflict, + ElfW(Rela) *conflictend) +{ + if (__builtin_expect (_dl_debug_mask & DL_DEBUG_RELOC, 0)) + _dl_printf ("\nconflict processing: %s\n", + l->l_name[0] ? l->l_name : _dl_argv[0]); + + { + /* Do the conflict relocation of the object and library GOT and other + data. */ + + /* This macro is used as a callback from the ELF_DYNAMIC_RELOCATE code. */ +#define RESOLVE_MAP(ref, version, flags) (*ref = NULL, 0) +#define RESOLVE(ref, version, flags) (*ref = NULL, 0) + +#include "dynamic-link.h" + + _dl_num_cache_relocations += conflictend - conflict; + + for (; conflict < conflictend; ++conflict) + elf_machine_rela (l, conflict, NULL, NULL, (void *) conflict->r_offset); + } +} --- glibc-2.2.4-cygnus/elf/dl-deps.c 2001/07/09 18:56:58 1.1.1.17 +++ glibc-2.2.4-redhat/elf/dl-deps.c 2001/07/09 19:42:52 1.15 @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -70,6 +71,21 @@ openaux (void *a) args->trace_mode, 0); } +static ptrdiff_t +internal_function +_dl_build_local_scope (struct link_map **list, struct link_map *map) +{ + struct link_map **p = list; + struct link_map **q; + + *p++ = map; + map->l_reserved = 1; + if (map->l_initfini) + for (q = map->l_initfini; *q; q++) + if (! (*q)->l_reserved) + p += _dl_build_local_scope (p, *q); + return p - list; +} /* We use a very special kind of list to track the path @@ -498,6 +514,47 @@ out: /* Now clear all the mark bits we set in the objects on the search list to avoid duplicates, so the next call starts fresh. */ runp->map->l_reserved = 0; + } + + if (__builtin_expect(_dl_debug_mask & DL_DEBUG_PRELINK, 0) != 0 + && map == _dl_loaded) + { + /* If we are to compute conflicts, we have to build local scope + for each library, not just the ultimate loader. */ + for (i = 1; i < nlist; ++i) + { + struct link_map *l = map->l_searchlist.r_list[i]; + unsigned int j, cnt; + + /* The local scope has been already computed. */ + if (l->l_local_scope[0] + && l->l_local_scope[0]->r_nlist != 0) + continue; + + if (l->l_info[AUXTAG] || l->l_info[FILTERTAG]) + { + /* FIXME: This code does not handle filters yet. */ + _dl_signal_error (EINVAL, l->l_name, + N_("Filters not supported with LD_TRACE_PRELINKING")); + } + + cnt = _dl_build_local_scope (map->l_initfini, l); + assert (cnt <= nlist); + for (j = 0; j < cnt; j++) + map->l_initfini[j]->l_reserved = 0; + + l->l_local_scope[0] = + (struct r_scope_elem *) malloc (sizeof (struct r_scope_elem) + + cnt * sizeof (struct link_map *)); + if (l->l_local_scope[0] == NULL) + _dl_signal_error (ENOMEM, map->l_name, + N_("cannot allocate symbol search list")); + l->l_local_scope[0]->r_nlist = cnt; + l->l_local_scope[0]->r_list = + (struct link_map **) (l->l_local_scope[0] + 1); + memcpy (l->l_local_scope[0]->r_list, map->l_initfini, + cnt * sizeof (struct link_map *)); + } } /* Now determine the order in which the initialization has to happen. */ --- glibc-2.2.4-cygnus/elf/dl-lookup.c 2001/08/27 07:57:28 1.1.1.15 +++ glibc-2.2.4-redhat/elf/dl-lookup.c 2001/08/27 09:49:39 1.9 @@ -184,6 +184,12 @@ _dl_do_lookup_versioned (const char *und const struct r_found_version *const version, struct link_map *skip, int type_class); +static void +internal_function +_dl_debug_bindings (const char *undef_name, struct link_map *undef_map, + const ElfW(Sym) **ref, struct r_scope_elem *symbol_scope[], + struct sym_val *value, const struct r_found_version *version, + int type_class, int protected); /* Search loaded objects' symbol tables for a definition of the symbol UNDEF_NAME. */ @@ -194,7 +200,7 @@ _dl_lookup_symbol (const char *undef_nam const ElfW(Sym) **ref, struct r_scope_elem *symbol_scope[], int type_class, int explicit) { - unsigned long int hash = _dl_elf_hash (undef_name); + const unsigned long int hash = _dl_elf_hash (undef_name); struct sym_val current_value = { NULL, NULL }; struct r_scope_elem **scope; int protected; @@ -233,7 +239,7 @@ _dl_lookup_symbol (const char *undef_nam if (*ref == NULL || ELFW(ST_BIND) ((*ref)->st_info) != STB_WEAK) /* We could find no value for a strong reference. */ /* XXX We cannot translate the messages. */ - _dl_signal_cerror (0, (reference_name && reference_name[0] + _dl_signal_cerror (0, (reference_name[0] ? reference_name : (_dl_argv[0] ?: "
")), make_string (undefined_msg, undef_name)); @@ -242,25 +248,7 @@ _dl_lookup_symbol (const char *undef_nam } protected = *ref && ELFW(ST_VISIBILITY) ((*ref)->st_other) == STV_PROTECTED; - - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_BINDINGS, 0)) - { - const char *reference_name = undef_map ? undef_map->l_name : NULL; - - _dl_debug_printf ("binding file %s to %s: %s symbol `%s'\n", - (reference_name && reference_name[0] - ? reference_name : (_dl_argv[0] ?: "
")), - current_value.m->l_name[0] - ? current_value.m->l_name : _dl_argv[0], - protected ? "protected" : "normal", undef_name); - } - - if (__builtin_expect (protected == 0, 1)) - { - *ref = current_value.s; - return LOOKUP_VALUE (current_value.m); - } - else + if (__builtin_expect (protected != 0, 0)) { /* It is very tricky. We need to figure out what value to return for the protected symbol */ @@ -271,14 +259,20 @@ _dl_lookup_symbol (const char *undef_nam 0, NULL, ELF_RTYPE_CLASS_PLT)) break; - if (protected_value.s == NULL || protected_value.m == undef_map) + if (protected_value.s != NULL && protected_value.m != undef_map) { - *ref = current_value.s; - return LOOKUP_VALUE (current_value.m); + current_value.s = *ref; + current_value.m = undef_map; } - - return LOOKUP_VALUE (undef_map); } + + if (__builtin_expect (_dl_debug_mask + & (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK), 0)) + _dl_debug_bindings (undef_name, undef_map, ref, symbol_scope, + ¤t_value, NULL, type_class, protected); + + *ref = current_value.s; + return LOOKUP_VALUE (current_value.m); } @@ -294,7 +288,6 @@ _dl_lookup_symbol_skip (const char *unde struct r_scope_elem *symbol_scope[], struct link_map *skip_map) { - const char *reference_name = undef_map ? undef_map->l_name : NULL; const unsigned long int hash = _dl_elf_hash (undef_name); struct sym_val current_value = { NULL, NULL }; struct r_scope_elem **scope; @@ -323,20 +316,7 @@ _dl_lookup_symbol_skip (const char *unde protected = *ref && ELFW(ST_VISIBILITY) ((*ref)->st_other) == STV_PROTECTED; - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_BINDINGS, 0)) - _dl_debug_printf ("binding file %s to %s: %s symbol `%s'\n", - (reference_name && reference_name[0] - ? reference_name : (_dl_argv[0] ?: "
")), - current_value.m->l_name[0] - ? current_value.m->l_name : _dl_argv[0], - protected ? "protected" : "normal", undef_name); - - if (__builtin_expect (protected == 0, 1)) - { - *ref = current_value.s; - return LOOKUP_VALUE (current_value.m); - } - else + if (__builtin_expect (protected != 0, 0)) { /* It is very tricky. We need to figure out what value to return for the protected symbol. */ @@ -350,14 +330,20 @@ _dl_lookup_symbol_skip (const char *unde 0, skip_map, ELF_RTYPE_CLASS_PLT)) break; - if (protected_value.s == NULL || protected_value.m == undef_map) + if (protected_value.s != NULL && protected_value.m != undef_map) { - *ref = current_value.s; - return LOOKUP_VALUE (current_value.m); + current_value.s = *ref; + current_value.m = undef_map; } - - return LOOKUP_VALUE (undef_map); } + + if (__builtin_expect (_dl_debug_mask + & (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK), 0)) + _dl_debug_bindings (undef_name, undef_map, ref, symbol_scope, + ¤t_value, NULL, 0, protected); + + *ref = current_value.s; + return LOOKUP_VALUE (current_value.m); } @@ -374,7 +360,7 @@ _dl_lookup_versioned_symbol (const char const struct r_found_version *version, int type_class, int explicit) { - unsigned long int hash = _dl_elf_hash (undef_name); + const unsigned long int hash = _dl_elf_hash (undef_name); struct sym_val current_value = { NULL, NULL }; struct r_scope_elem **scope; int protected; @@ -416,7 +402,7 @@ _dl_lookup_versioned_symbol (const char const char *reference_name = undef_map ? undef_map->l_name : NULL; /* XXX We cannot translate the message. */ - _dl_signal_cerror (0, (reference_name && reference_name[0] + _dl_signal_cerror (0, (reference_name[0] ? reference_name : (_dl_argv[0] ?: "
")), make_string ("symbol ", undef_name, ", version ", @@ -439,7 +425,7 @@ _dl_lookup_versioned_symbol (const char const char *reference_name = undef_map ? undef_map->l_name : NULL; /* XXX We cannot translate the message. */ - _dl_signal_cerror (0, (reference_name && reference_name[0] + _dl_signal_cerror (0, (reference_name[0] ? reference_name : (_dl_argv[0] ?: "
")), make_string (undefined_msg, undef_name, @@ -451,27 +437,9 @@ _dl_lookup_versioned_symbol (const char } protected = *ref && ELFW(ST_VISIBILITY) ((*ref)->st_other) == STV_PROTECTED; - - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_BINDINGS, 0)) - { - const char *reference_name = undef_map ? undef_map->l_name : NULL; - - _dl_debug_printf ("binding file %s to %s: %s symbol `%s' [%s]\n", - (reference_name && reference_name[0] - ? reference_name : (_dl_argv[0] ?: "
")), - current_value.m->l_name[0] - ? current_value.m->l_name : _dl_argv[0], - protected ? "protected" : "normal", - undef_name, version->name); - } - if (__builtin_expect (protected == 0, 1)) + if (__builtin_expect (protected != 0, 0)) { - *ref = current_value.s; - return LOOKUP_VALUE (current_value.m); - } - else - { /* It is very tricky. We need to figure out what value to return for the protected symbol */ struct sym_val protected_value = { NULL, NULL }; @@ -482,14 +450,20 @@ _dl_lookup_versioned_symbol (const char ELF_RTYPE_CLASS_PLT)) break; - if (protected_value.s == NULL || protected_value.m == undef_map) + if (protected_value.s != NULL && protected_value.m != undef_map) { - *ref = current_value.s; - return LOOKUP_VALUE (current_value.m); + current_value.s = *ref; + current_value.m = undef_map; } - - return LOOKUP_VALUE (undef_map); } + + if (__builtin_expect (_dl_debug_mask + & (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK), 0)) + _dl_debug_bindings (undef_name, undef_map, ref, symbol_scope, + ¤t_value, version, type_class, protected); + + *ref = current_value.s; + return LOOKUP_VALUE (current_value.m); } @@ -504,7 +478,7 @@ _dl_lookup_versioned_symbol_skip (const const struct r_found_version *version, struct link_map *skip_map) { - const char *reference_name = undef_map ? undef_map->l_name : NULL; + const char *reference_name = undef_map->l_name; const unsigned long int hash = _dl_elf_hash (undef_name); struct sym_val current_value = { NULL, NULL }; struct r_scope_elem **scope; @@ -535,7 +509,7 @@ _dl_lookup_versioned_symbol_skip (const __mempcpy (__mempcpy (buf, undefined_msg, sizeof undefined_msg - 1), undef_name, len + 1); /* XXX We cannot translate the messages. */ - _dl_signal_cerror (0, (reference_name && reference_name[0] + _dl_signal_cerror (0, (reference_name[0] ? reference_name : (_dl_argv[0] ?: "
")), buf); } @@ -544,22 +518,8 @@ _dl_lookup_versioned_symbol_skip (const } protected = *ref && ELFW(ST_VISIBILITY) ((*ref)->st_other) == STV_PROTECTED; - - if (__builtin_expect (_dl_debug_mask & DL_DEBUG_BINDINGS, 0)) - _dl_debug_printf ("binding file %s to %s: %s symbol `%s' [%s]\n", - (reference_name && reference_name[0] - ? reference_name : (_dl_argv[0] ?: "
")), - current_value.m->l_name[0] - ? current_value.m->l_name : _dl_argv[0], - protected ? "protected" : "normal", - undef_name, version->name); - if (__builtin_expect (protected == 0, 1)) - { - *ref = current_value.s; - return LOOKUP_VALUE (current_value.m); - } - else + if (__builtin_expect (protected != 0, 0)) { /* It is very tricky. We need to figure out what value to return for the protected symbol */ @@ -575,14 +535,20 @@ _dl_lookup_versioned_symbol_skip (const skip_map, ELF_RTYPE_CLASS_PLT)) break; - if (protected_value.s == NULL || protected_value.m == undef_map) + if (protected_value.s != NULL && protected_value.m != undef_map) { - *ref = current_value.s; - return LOOKUP_VALUE (current_value.m); + current_value.s = *ref; + current_value.m = undef_map; } - - return LOOKUP_VALUE (undef_map); } + + if (__builtin_expect (_dl_debug_mask + & (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK), 0)) + _dl_debug_bindings (undef_name, undef_map, ref, symbol_scope, + ¤t_value, version, 0, protected); + + *ref = current_value.s; + return LOOKUP_VALUE (current_value.m); } @@ -604,6 +570,79 @@ _dl_setup_hash (struct link_map *map) map->l_buckets = hash; hash += map->l_nbuckets; map->l_chain = hash; +} + +static void +internal_function +_dl_debug_bindings (const char *undef_name, struct link_map *undef_map, + const ElfW(Sym) **ref, struct r_scope_elem *symbol_scope[], + struct sym_val *value, const struct r_found_version *version, + int type_class, int protected) +{ + const char *reference_name = undef_map->l_name; + + if (_dl_debug_mask & DL_DEBUG_BINDINGS) + { + _dl_debug_printf ("binding file %s to %s: %s symbol `%s'", + (reference_name[0] + ? reference_name : (_dl_argv[0] ?: "
")), + value->m->l_name[0] ? value->m->l_name : _dl_argv[0], + protected ? "protected" : "normal", + undef_name); + if (version) + _dl_debug_printf_c (" [%s]\n", version->name); + else + _dl_debug_printf_c ("\n"); + } +#ifdef SHARED + if (_dl_debug_mask & DL_DEBUG_PRELINK) + { + int conflict = 0; + struct sym_val val = { NULL, NULL }; + + if ((_dl_trace_prelink_map == NULL + || _dl_trace_prelink_map == _dl_loaded) + && undef_map != _dl_loaded) + { + const unsigned long int hash = _dl_elf_hash (undef_name); + + if (version == 0) + _dl_do_lookup (undef_name, hash, *ref, &val, + undef_map->l_local_scope[0], 0, NULL, type_class); + else + _dl_do_lookup_versioned (undef_name, hash, *ref, &val, + undef_map->l_local_scope[0], 0, version, + NULL, type_class); + + if (val.s != value->s || val.m != value->m) + conflict = 1; + } + + if (conflict + || _dl_trace_prelink_map == undef_map + || _dl_trace_prelink_map == NULL) + { + _dl_printf ("%s 0x%0*Zx 0x%0*Zx -> 0x%0*Zx 0x%0*Zx ", + conflict ? "conflict" : "lookup", + (int) sizeof (ElfW(Addr)) * 2, undef_map->l_map_start, + (int) sizeof (ElfW(Addr)) * 2, + ((ElfW(Addr)) *ref) - undef_map->l_map_start, + (int) sizeof (ElfW(Addr)) * 2, + (ElfW(Addr)) (value->s ? value->m->l_map_start : 0), + (int) sizeof (ElfW(Addr)) * 2, + (ElfW(Addr)) (value->s ? value->s->st_value : 0)); + + if (conflict) + _dl_printf ("x 0x%0*Zx 0x%0*Zx ", + (int) sizeof (ElfW(Addr)) * 2, + (ElfW(Addr)) (val.s ? val.m->l_map_start : 0), + (int) sizeof (ElfW(Addr)) * 2, + (ElfW(Addr)) (val.s ? val.s->st_value : 0)); + + _dl_printf ("/%x %s\n", type_class, undef_name); + } + } +#endif } /* These are here so that we only inline do_lookup{,_versioned} in the common --- glibc-2.2.4-cygnus/elf/dl-runtime.c 2001/08/27 07:57:29 1.1.1.12 +++ glibc-2.2.4-redhat/elf/dl-runtime.c 2001/08/27 08:48:40 1.3 @@ -23,7 +23,8 @@ #include #include "dynamic-link.h" -#if !defined ELF_MACHINE_NO_RELA || ELF_MACHINE_NO_REL +#if (!defined ELF_MACHINE_NO_RELA && !defined ELF_MACHINE_PLT_REL) \ + || ELF_MACHINE_NO_REL # define PLTREL ElfW(Rela) #else # define PLTREL ElfW(Rel) --- glibc-2.2.4-cygnus/elf/do-rel.h 2001/08/27 07:57:29 1.1.1.6 +++ glibc-2.2.4-redhat/elf/do-rel.h 2001/08/27 08:48:40 1.7 @@ -48,7 +48,7 @@ elf_dynamic_do_rel (struct link_map *map const ElfW(Rel) *end = (const void *) (reladdr + relsize); ElfW(Addr) l_addr = map->l_addr; -#ifndef RTLD_BOOTSTRAP +#if (!defined DO_RELA || !defined ELF_MACHINE_PLT_REL) && !defined RTLD_BOOTSTRAP /* We never bind lazily during ld.so bootstrap. Unfortunately gcc is not clever enough to see through all the function calls to realize that. */ --- glibc-2.2.4-cygnus/elf/dynamic-link.h 2001/07/09 18:56:58 1.1.1.5 +++ glibc-2.2.4-redhat/elf/dynamic-link.h 2001/07/09 19:42:52 1.2 @@ -1,5 +1,5 @@ /* Inline functions for dynamic linking. - Copyright (C) 1995,96,97,98,99,2000 Free Software Foundation, Inc. + Copyright (C) 1995,96,97,98,99,2000,2001 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 @@ -58,31 +58,39 @@ elf_get_dynamic_info (struct link_map *l else if ((Elf32_Word) DT_EXTRATAGIDX (dyn->d_tag) < DT_EXTRANUM) info[DT_EXTRATAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGNUM] = dyn; + else if ((Elf32_Word) DT_VALTAGIDX (dyn->d_tag) < DT_VALNUM) + info[DT_VALTAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM + + DT_VERSIONTAGNUM + DT_EXTRANUM] = dyn; + else if ((Elf32_Word) DT_ADDRTAGIDX (dyn->d_tag) < DT_ADDRNUM) + info[DT_ADDRTAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM + + DT_VERSIONTAGNUM + DT_EXTRANUM + DT_VALNUM] = dyn; else assert (! "bad dynamic tag"); ++dyn; } #ifndef DL_RO_DYN_SECTION - if (info[DT_PLTGOT] != NULL) - info[DT_PLTGOT]->d_un.d_ptr += l_addr; - if (info[DT_STRTAB] != NULL) - info[DT_STRTAB]->d_un.d_ptr += l_addr; - if (info[DT_SYMTAB] != NULL) - info[DT_SYMTAB]->d_un.d_ptr += l_addr; -# if ! ELF_MACHINE_NO_RELA - if (info[DT_RELA] != NULL) + /* Don't adjust .dynamic unnecessarily. */ + if (l_addr) { - assert (info[DT_RELAENT]->d_un.d_val == sizeof (ElfW(Rela))); - info[DT_RELA]->d_un.d_ptr += l_addr; - } + if (info[DT_PLTGOT] != NULL) + info[DT_PLTGOT]->d_un.d_ptr += l_addr; + if (info[DT_STRTAB] != NULL) + info[DT_STRTAB]->d_un.d_ptr += l_addr; + if (info[DT_SYMTAB] != NULL) + info[DT_SYMTAB]->d_un.d_ptr += l_addr; +# if ! ELF_MACHINE_NO_RELA + if (info[DT_RELA] != NULL) + info[DT_RELA]->d_un.d_ptr += l_addr; # endif # if ! ELF_MACHINE_NO_REL - if (info[DT_REL] != NULL) - { - assert (info[DT_RELENT]->d_un.d_val == sizeof (ElfW(Rel))); - info[DT_REL]->d_un.d_ptr += l_addr; - } + if (info[DT_REL] != NULL) + info[DT_REL]->d_un.d_ptr += l_addr; # endif + if (info[DT_JMPREL] != NULL) + info[DT_JMPREL]->d_un.d_ptr += l_addr; + if (info[VERSYMIDX (DT_VERSYM)] != NULL) + info[VERSYMIDX (DT_VERSYM)]->d_un.d_ptr += l_addr; + } #endif if (info[DT_PLTREL] != NULL) { @@ -95,12 +103,14 @@ elf_get_dynamic_info (struct link_map *l || info[DT_PLTREL]->d_un.d_val == DT_RELA); # endif } -#ifndef DL_RO_DYN_SECTION - if (info[DT_JMPREL] != NULL) - info[DT_JMPREL]->d_un.d_ptr += l_addr; - if (info[VERSYMIDX (DT_VERSYM)] != NULL) - info[VERSYMIDX (DT_VERSYM)]->d_un.d_ptr += l_addr; -#endif +# if ! ELF_MACHINE_NO_RELA + if (info[DT_RELA] != NULL) + assert (info[DT_RELAENT]->d_un.d_val == sizeof (ElfW(Rela))); +# endif +# if ! ELF_MACHINE_NO_REL + if (info[DT_REL] != NULL) + assert (info[DT_RELENT]->d_un.d_val == sizeof (ElfW(Rel))); +# endif if (info[DT_FLAGS] != NULL) { /* Flags are used. Translate to the old form where available. @@ -177,8 +187,8 @@ elf_get_dynamic_info (struct link_map *l \ if ((map)->l_info[DT_##RELOC]) \ { \ - ranges[0].start = D_PTR ((map), l_info[DT_##RELOC]); \ - ranges[0].size = (map)->l_info[DT_##RELOC##SZ]->d_un.d_val; \ + ranges[0].start = D_PTR ((map), l_info[DT_##RELOC]); \ + ranges[0].size = (map)->l_info[DT_##RELOC##SZ]->d_un.d_val; \ } \ if ((map)->l_info[DT_PLTREL] \ && (!test_rel || (map)->l_info[DT_PLTREL]->d_un.d_val == DT_##RELOC)) \ --- glibc-2.2.4-cygnus/elf/elf.h 2001/07/23 19:17:51 1.1.1.23 +++ glibc-2.2.4-redhat/elf/elf.h 2001/07/23 20:00:36 1.8 @@ -316,6 +316,7 @@ typedef struct #define SHT_SYMTAB_SHNDX 18 /* Extended section indeces */ #define SHT_NUM 19 /* Number of defined types. */ #define SHT_LOOS 0x60000000 /* Start OS-specific */ +#define SHT_GNU_LIBLIST 0x6ffffff7 /* Prelink library list */ #define SHT_CHECKSUM 0x6ffffff8 /* Checksum for DSO content. */ #define SHT_LOSUNW 0x6ffffffa /* Sun-specific low bound. */ #define SHT_SUNW_move 0x6ffffffa @@ -649,6 +650,9 @@ typedef struct Dyn.d_un.d_val field of the Elf*_Dyn structure. This follows Sun's approach. */ #define DT_VALRNGLO 0x6ffffd00 +#define DT_GNU_PRELINKED 0x6ffffdf5 /* Prelinking timestamp */ +#define DT_GNU_CONFLICTSZ 0x6ffffdf6 /* Size of conflict section */ +#define DT_GNU_LIBLISTSZ 0x6ffffdf7 /* Size of library list */ #define DT_CHECKSUM 0x6ffffdf8 #define DT_PLTPADSZ 0x6ffffdf9 #define DT_MOVEENT 0x6ffffdfa @@ -659,6 +663,8 @@ typedef struct #define DT_SYMINSZ 0x6ffffdfe /* Size of syminfo table (in bytes) */ #define DT_SYMINENT 0x6ffffdff /* Entry size of syminfo */ #define DT_VALRNGHI 0x6ffffdff +#define DT_VALTAGIDX(tag) (DT_VALRNGHI - (tag)) /* Reverse order! */ +#define DT_VALNUM 12 /* DT_* entries which fall between DT_ADDRRNGHI & DT_ADDRRNGLO use the Dyn.d_un.d_ptr field of the Elf*_Dyn structure. @@ -666,6 +672,8 @@ typedef struct If any adjustment is made to the ELF object after it has been built these entries will need to be adjusted. */ #define DT_ADDRRNGLO 0x6ffffe00 +#define DT_GNU_CONFLICT 0x6ffffef8 /* Start of conflict section */ +#define DT_GNU_LIBLIST 0x6ffffef9 /* Library list */ #define DT_CONFIG 0x6ffffefa /* Configuration information. */ #define DT_DEPAUDIT 0x6ffffefb /* Dependency auditing. */ #define DT_AUDIT 0x6ffffefc /* Object auditing. */ @@ -673,6 +681,8 @@ typedef struct #define DT_MOVETAB 0x6ffffefe /* Move table. */ #define DT_SYMINFO 0x6ffffeff /* Syminfo table. */ #define DT_ADDRRNGHI 0x6ffffeff +#define DT_ADDRTAGIDX(tag) (DT_ADDRRNGHI - (tag)) /* Reverse order! */ +#define DT_ADDRNUM 10 /* The versioning entry types. The next are defined as part of the GNU extension. */ --- glibc-2.2.4-cygnus/elf/rtld.c 2001/09/03 12:28:24 1.1.1.34 +++ glibc-2.2.4-redhat/elf/rtld.c 2001/09/03 12:55:50 1.39 @@ -67,6 +67,8 @@ struct r_search_path *_dl_search_paths; const char *_dl_profile; const char *_dl_profile_output; struct link_map *_dl_profile_map; +const char *_dl_trace_prelink; +struct link_map *_dl_trace_prelink_map; int _dl_lazy = 1; /* XXX I know about at least one case where we depend on the old weak behavior (it has to do with librt). Until we get DSO groups implemented @@ -145,6 +147,13 @@ RTLD_START # error "sysdeps/MACHINE/dl-machine.h fails to define RTLD_START" #endif +#ifndef VALIDX +# define VALIDX(tag) (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGNUM \ + + DT_EXTRANUM + DT_VALTAGIDX (tag)) +# define ADDRIDX(tag) (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGNUM \ + + DT_EXTRANUM + DT_VALNUM + DT_ADDRTAGIDX (tag)) +#endif + static ElfW(Addr) _dl_start (void *arg) { @@ -183,10 +192,14 @@ _dl_start (void *arg) ELF_MACHINE_BEFORE_RTLD_RELOC (bootstrap_map.l_info); #endif - /* Relocate ourselves so we can do normal function calls and - data access using the global offset table. */ + if (bootstrap_map.l_addr || ! bootstrap_map.l_info[VALIDX(DT_GNU_PRELINKED)]) + { + /* Relocate ourselves so we can do normal function calls and + data access using the global offset table. */ + + ELF_DYNAMIC_RELOCATE (&bootstrap_map, 0, 0); + } - ELF_DYNAMIC_RELOCATE (&bootstrap_map, 0, 0); /* Please note that we don't allow profiling of this object and therefore need not test whether we have to allocate the array for the relocation results (as done in dl-reloc.c). */ @@ -383,6 +396,7 @@ dl_main (const ElfW(Phdr) *phdr, char *file; int has_interp = 0; unsigned int i; + int prelinked = 0; int rtld_is_main = 0; #ifndef HP_TIMING_NONAVAIL hp_timing_t start; @@ -789,6 +803,62 @@ of this helper program; chances are you __munmap (file, file_size); } + +#if defined(__i386__) || defined(__alpha__) || (defined(__sparc__) && !defined(__arch64__)) + /* + * Modifications by Red Hat Software + * + * Deal with the broken binaries from the non-versioned ages of glibc. + * If a binary does not have version information enabled, we assume that + * it is a glibc 2.0 binary and we load a compatibility library to try to + * overcome binary incompatibilities. + * Blame: gafton@redhat.com + */ +#define LIB_NOVERSION "/lib/libNoVersion.so.1" + + if (_dl_loaded->l_info[DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (DT_VERNEED)] == NULL) { + struct stat test_st; + int test_fd; + int can_load; + + HP_TIMING_NOW (start); + +/* _dl_sysdep_message("Loading compatibility library... ", NULL); */ + + can_load = 1; + test_fd = __open (LIB_NOVERSION, O_RDONLY); + if (test_fd < 0) { + can_load = 0; +/* _dl_sysdep_message(" Can't find " LIB_NOVERSION "\n", NULL); */ + } else { + if (__fxstat (_STAT_VER, test_fd, &test_st) < 0 || test_st.st_size == 0) { + can_load = 0; +/* _dl_sysdep_message(" Can't stat " LIB_NOVERSION "\n", NULL); */ + } + } + + if (test_fd >= 0) /* open did no fail.. */ + __close(test_fd); /* avoid fd leaks */ + + if (can_load != 0) { + struct link_map *new_map; + new_map = _dl_map_object (_dl_loaded, LIB_NOVERSION, + 1, lt_library, 0, 0); + if (++new_map->l_opencount == 1) { + /* It is no duplicate. */ + ++npreloads; +/* _dl_sysdep_message(" DONE\n", NULL); */ + } else { +/* _dl_sysdep_message(" FAILED\n", NULL); */ + } + } + + HP_TIMING_NOW (stop); + HP_TIMING_DIFF (diff, start, stop); + HP_TIMING_ACCUM_NT (load_time, diff); + } +#endif + if (__builtin_expect (npreloads, 0) != 0) { /* Set up PRELOADS with a vector of the preloaded libraries. */ @@ -884,14 +954,81 @@ of this helper program; chances are you else { struct link_map *l; + ElfW(Addr) l_addr; - for (l = _dl_loaded->l_next; l; l = l->l_next) - if (l->l_faked) - /* The library was not found. */ - _dl_printf ("\t%s => not found\n", l->l_libname->name); - else - _dl_printf ("\t%s => %s (0x%0*Zx)\n", l->l_libname->name, - l->l_name, (int) sizeof l->l_addr * 2, l->l_addr); + /* Try to figure dynamic linker's real map start (which may be + different than _dl_rtld_map.l_addr). + Assuming no target has page size less than 1024 bytes + and .hash being the first real section. */ + if (_dl_rtld_map.l_info[DT_HASH] + && (l_addr = _dl_rtld_map.l_addr + + (_dl_rtld_map.l_info[DT_HASH]->d_un.d_ptr + & ~(ElfW(Addr))1023)), + memcmp ((char *) l_addr, ELFMAG, SELFMAG) == 0) + { + ElfW(Ehdr) *ehdr = (ElfW(Ehdr) *) l_addr; + ElfW(Phdr) *ph, *phdr = + (ElfW(Phdr) *)(l_addr + ehdr->e_phoff); + ElfW(Half) phnum = ehdr->e_phnum; + + if (((ElfW(Addr)) &phdr[phnum]) - l_addr + <= (_dl_rtld_map.l_info[DT_HASH]->d_un.d_ptr & 1023)) + { + _dl_rtld_map.l_map_end = 0; + for (ph = phdr; ph < &phdr[phnum]; ++ph) + if (ph->p_type == PT_LOAD) + { + ElfW(Addr) mapstart, allocend; + mapstart = _dl_rtld_map.l_addr + + (ph->p_vaddr & ~(ph->p_align - 1)); + allocend = _dl_rtld_map.l_addr + + ph->p_vaddr + ph->p_memsz; + if (_dl_rtld_map.l_map_start > mapstart) + _dl_rtld_map.l_map_start = mapstart; + if (_dl_rtld_map.l_map_end < allocend) + _dl_rtld_map.l_map_end = allocend; + } + if (_dl_rtld_map.l_map_end == 0) + _dl_rtld_map.l_map_end = ~0; + } + } + + if (_dl_debug_mask & DL_DEBUG_PRELINK) + { + struct r_scope_elem *scope = &_dl_loaded->l_searchlist; + + for (i = 0; i < scope->r_nlist; i++) + { + l = scope->r_list [i]; + if (l->l_faked) + { + _dl_printf ("\t%s => not found\n", l->l_libname->name); + continue; + } + if (_dl_name_match_p (_dl_trace_prelink, l)) + _dl_trace_prelink_map = l; + _dl_printf ("\t%s => %s (0x%0*Zx, 0x%0*Zx)\n", + l->l_libname->name[0] ? l->l_libname->name + : _dl_argv[0] ?: "
", + l->l_name[0] ? l->l_name + : _dl_argv[0] ?: "
", + (int) sizeof l->l_map_start * 2, + l->l_map_start, + (int) sizeof l->l_addr * 2, + l->l_addr); + } + } + else + { + for (l = _dl_loaded->l_next; l; l = l->l_next) + if (l->l_faked) + /* The library was not found. */ + _dl_printf ("\t%s => not found\n", l->l_libname->name); + else + _dl_printf ("\t%s => %s (0x%0*Zx)\n", l->l_libname->name, + l->l_name, (int) sizeof l->l_map_start * 2, + l->l_map_start); + } } if (__builtin_expect (mode, trace) != trace) @@ -936,6 +1073,10 @@ of this helper program; chances are you } l = l->l_prev; } while (l); + + if ((_dl_debug_mask & DL_DEBUG_PRELINK) + && _dl_rtld_map.l_opencount > 1) + _dl_relocate_object (&_dl_rtld_map, _dl_loaded->l_scope, 0, 0); } #define VERNEEDTAG (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (DT_VERNEED)) @@ -1014,6 +1155,84 @@ of this helper program; chances are you _exit (0); } + if (_dl_loaded->l_info [ADDRIDX (DT_GNU_LIBLIST)] + && ! __builtin_expect (_dl_profile != NULL, 0)) + { + ElfW(Lib) *liblist, *liblistend; + struct link_map **r_list, **r_listend, *l; + const char *strtab = (const void *) + D_PTR (_dl_loaded, l_info[DT_STRTAB]); + + assert (_dl_loaded->l_info [VALIDX (DT_GNU_LIBLISTSZ)] != NULL); + liblist = (ElfW(Lib) *) + _dl_loaded->l_info [ADDRIDX (DT_GNU_LIBLIST)]->d_un.d_ptr; + liblistend = (ElfW(Lib) *) + ((char *) liblist + + _dl_loaded->l_info [VALIDX (DT_GNU_LIBLISTSZ)]->d_un.d_val); + r_list = _dl_loaded->l_searchlist.r_list; + r_listend = r_list + _dl_loaded->l_searchlist.r_nlist; + + for (; r_list < r_listend && liblist < liblistend; r_list++) + { + l = *r_list; + + if (l == _dl_loaded) + continue; + + /* If the library is not mapped where it should, fail. */ + if (l->l_addr) + break; + + /* Next, check if checksum matches. */ + if (l->l_info [VALIDX(DT_CHECKSUM)] == NULL + || l->l_info [VALIDX(DT_CHECKSUM)]->d_un.d_val + != liblist->l_checksum) + break; + + if (l->l_info [VALIDX(DT_GNU_PRELINKED)] == NULL + || l->l_info [VALIDX(DT_GNU_PRELINKED)]->d_un.d_val + != liblist->l_time_stamp) + break; + + if (! _dl_name_match_p (strtab + liblist->l_name, l)) + break; + + ++liblist; + } + + + if (r_list == r_listend && liblist == liblistend) + prelinked = 1; + + if (__builtin_expect (_dl_debug_mask & DL_DEBUG_LIBS, 0)) + _dl_printf ("\nprelink checking: %s\n", prelinked ? "ok" : "failed"); + } + + if (prelinked) + { + if (_dl_loaded->l_info [ADDRIDX (DT_GNU_CONFLICT)] != NULL) + { + ElfW(Rela) *conflict, *conflictend; +#ifndef HP_TIMING_NONAVAIL + hp_timing_t start; + hp_timing_t stop; +#endif + + HP_TIMING_NOW (start); + assert (_dl_loaded->l_info [VALIDX (DT_GNU_CONFLICTSZ)] != NULL); + conflict = (ElfW(Rela) *) + _dl_loaded->l_info [ADDRIDX (DT_GNU_CONFLICT)]->d_un.d_ptr; + conflictend = (ElfW(Rela) *) + ((char *) conflict + + _dl_loaded->l_info [VALIDX (DT_GNU_CONFLICTSZ)]->d_un.d_val); + _dl_resolve_conflicts (_dl_loaded, conflict, conflictend); + HP_TIMING_NOW (stop); + HP_TIMING_DIFF (relocate_time, start, stop); + } + + _dl_sysdep_start_cleanup (); + } + else { /* Now we have all the objects loaded. Relocate them all except for the dynamic linker itself. We do this in reverse order so that copy @@ -1094,7 +1313,7 @@ of this helper program; chances are you _dl_main_searchlist = &_dl_loaded->l_searchlist; _dl_global_scope[0] = &_dl_loaded->l_searchlist; - /* Safe the information about the original global scope list since + /* Save the information about the original global scope list since we need it in the memory handling later. */ _dl_initial_searchlist = *_dl_main_searchlist; @@ -1407,6 +1626,17 @@ process_envvars (enum mode *modep) _dl_profile_output = &envline[15]; if (*_dl_profile_output == '\0') _dl_profile_output = "/var/tmp"; + } + break; + + case 16: + /* The mode of the dynamic linker can be set. */ + if (memcmp (envline, "TRACE_PRELINKING", 16) == 0) + { + mode = trace; + _dl_verbose = 1; + _dl_debug_mask |= DL_DEBUG_PRELINK; + _dl_trace_prelink = &envline[17]; } break; --- glibc-2.2.4-cygnus/iconv/strtab.c 2001/09/01 09:13:33 1.1.1.2 +++ glibc-2.2.4-redhat/iconv/strtab.c 2001/09/04 18:50:05 1.2 @@ -90,13 +90,21 @@ extern size_t strtaboffset (struct Stren struct Strtab * strtabinit (void) { + struct Strtab *ret; + if (ps == 0) { ps = sysconf (_SC_PAGESIZE) - 2 * sizeof (void *); assert (sizeof (struct memoryblock) < ps); } - return (struct Strtab *) calloc (1, sizeof (struct Strtab)); + ret = (struct Strtab *) calloc (1, sizeof (struct Strtab)); + if (ret != NULL) + { + ret->null.len = 1; + ret->null.string = ""; + } + return ret; } @@ -141,10 +149,6 @@ newstring (struct Strtab *st, const char size_t align; int i; - /* Compute the string length if the caller doesn't know it. */ - if (len == 0) - len = strlen (str) + 1; - /* Compute the amount of padding needed to make the structure aligned. */ align = ((__alignof__ (struct Strent) - (((uintptr_t) st->backp) @@ -211,6 +215,14 @@ strtabadd (struct Strtab *st, const char struct Strent *newstr; struct Strent **sep; + /* Compute the string length if the caller doesn't know it. */ + if (len == 0) + len = strlen (str) + 1; + + /* Make sure all "" strings get offset 0. */ + if (len == 1) + return &st->null; + /* Allocate memory for the new string and its associated information. */ newstr = newstring (st, str, len); @@ -223,6 +235,19 @@ strtabadd (struct Strtab *st, const char /* This is not the same entry. This means we have a prefix match. */ if ((*sep)->len > newstr->len) { + struct Strent *subs; + + for (subs = (*sep)->next; subs; subs = subs->next) + if (subs->len == newstr->len) + { + /* We have an exact match with a substring. Free the memory + we allocated. */ + st->left += st->backp - (char *) newstr; + st->backp = (char *) newstr; + + return subs; + } + /* We have a new substring. This means we don't need the reverse string of this entry anymore. */ st->backp -= newstr->len; @@ -238,6 +263,8 @@ strtabadd (struct Strtab *st, const char it is longer. In this case we have to put it first. */ st->total += newstr->len - (*sep)->len; newstr->next = *sep; + newstr->left = (*sep)->left; + newstr->right = (*sep)->right; *sep = newstr; } else --- glibc-2.2.4-cygnus/include/link.h 2001/08/27 07:57:40 1.1.1.11 +++ glibc-2.2.4-redhat/include/link.h 2001/08/27 09:49:39 1.6 @@ -25,6 +25,7 @@ #include #include #include +#include /* We use this macro to refer to ELF types independent of the native wordsize. `ElfW(TYPE)' is used in place of `Elf32_TYPE' or `Elf64_TYPE'. */ @@ -132,14 +133,20 @@ struct link_map /* Indexed pointers to dynamic section. [0,DT_NUM) are indexed by the processor-independent tags. [DT_NUM,DT_NUM+DT_THISPROCNUM) are indexed by the tag minus DT_LOPROC. - [DT_NUM+DT_THISPROCNUM,DT_NUM+DT_THISPROCNUM+DT_EXTRANUM) are indexed - by DT_EXTRATAGIDX(tagvalue) and + [DT_NUM+DT_THISPROCNUM,DT_NUM+DT_THISPROCNUM+DT_VERSIONTAGNUM) are + indexed by DT_VERSIONTAGIDX(tagvalue). [DT_NUM+DT_THISPROCNUM+DT_VERSIONTAGNUM, - DT_NUM+DT_THISPROCNUM+DT_VERSIONTAGNUM+DT_EXTRANUM) - are indexed by DT_EXTRATAGIDX(tagvalue) (see ). */ + DT_NUM+DT_THISPROCNUM+DT_VERSIONTAGNUM+DT_EXTRANUM) are indexed by + DT_EXTRATAGIDX(tagvalue). + [DT_NUM+DT_THISPROCNUM+DT_VERSIONTAGNUM+DT_EXTRANUM, + DT_NUM+DT_THISPROCNUM+DT_VERSIONTAGNUM+DT_EXTRANUM+DT_VALNUM) are + indexed by DT_VALTAGIDX(tagvalue) and + [DT_NUM+DT_THISPROCNUM+DT_VERSIONTAGNUM+DT_EXTRANUM+DT_VALNUM, + DT_NUM+DT_THISPROCNUM+DT_VERSIONTAGNUM+DT_EXTRANUM+DT_VALNUM+DT_ADDRNUM) + are indexed by DT_ADDRTAGIDX(tagvalue), see . */ ElfW(Dyn) *l_info[DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGNUM - + DT_EXTRANUM]; + + DT_EXTRANUM + DT_VALNUM + DT_ADDRNUM]; const ElfW(Phdr) *l_phdr; /* Pointer to program header table in core. */ ElfW(Addr) l_entry; /* Entry point location. */ ElfW(Half) l_phnum; /* Number of program header entries. */ --- glibc-2.2.4-cygnus/inet/rcmd.c 2001/08/20 08:17:20 1.1.1.13 +++ glibc-2.2.4-redhat/inet/rcmd.c 2001/08/22 10:17:19 1.12 @@ -136,14 +136,23 @@ rcmd_af(ahost, rport, locuser, remuser, (void)__snprintf(num, sizeof(num), "%d", ntohs(rport)); error = getaddrinfo(*ahost, num, &hints, &res); if (error) { + if (error == EAI_NONAME && *ahost != NULL) { #ifdef USE_IN_LIBIO - if (_IO_fwide (stderr, 0) > 0) - __fwprintf(stderr, L"rcmd: getaddrinfo: %s\n", - gai_strerror(error)); - else + if (_IO_fwide (stderr, 0) > 0) + __fwprintf(stderr, L"%s: Unknown host\n", *ahost); + else #endif - fprintf(stderr, "rcmd: getaddrinfo: %s\n", - gai_strerror(error)); + fprintf(stderr, "%s: Unknown host\n", *ahost); + } else { +#ifdef USE_IN_LIBIO + if (_IO_fwide (stderr, 0) > 0) + __fwprintf(stderr, L"rcmd: getaddrinfo: %s\n", + gai_strerror(error)); + else +#endif + fprintf(stderr, "rcmd: getaddrinfo: %s\n", + gai_strerror(error)); + } return (-1); } --- glibc-2.2.4-cygnus/libio/stdio.h 2001/07/09 18:57:20 1.1.1.10 +++ glibc-2.2.4-redhat/libio/stdio.h 2001/07/09 19:42:53 1.6 @@ -133,10 +133,12 @@ typedef _G_fpos64_t fpos64_t; extern FILE *stdin; /* Standard input stream. */ extern FILE *stdout; /* Standard output stream. */ extern FILE *stderr; /* Standard error output stream. */ +#ifdef __STDC__ /* C89/C99 say they're macros. Make them happy. */ #define stdin stdin #define stdout stdout #define stderr stderr +#endif /* Remove file FILENAME. */ extern int remove (__const char *__filename) __THROW; --- glibc-2.2.4-cygnus/linuxthreads/lockfile.c 2001/08/16 06:26:37 1.1.1.5 +++ glibc-2.2.4-redhat/linuxthreads/lockfile.c 2001/08/16 06:55:48 1.6 @@ -103,7 +103,11 @@ __fresetlockfiles (void) __pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE_NP); for (i = _IO_iter_begin(); i != _IO_iter_end(); i = _IO_iter_next(i)) - __pthread_mutex_init (_IO_iter_file(i)->_lock, &attr); + { + _IO_lock_t *_lock = _IO_iter_file(i)->_lock; + if (_lock) + __pthread_mutex_init (_lock, &attr); + } __pthread_mutexattr_destroy (&attr); --- glibc-2.2.4-cygnus/locale/setlocale.c 2001/07/09 18:57:23 1.1.1.8 +++ glibc-2.2.4-redhat/locale/setlocale.c 2001/07/09 19:42:54 1.3 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 92, 95-99, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1991, 92, 95-99, 2000, 2001 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 @@ -326,9 +326,15 @@ setlocale (int category, const char *loc /* Make a copy of locale name. */ if (newnames[category] != _nl_C_name) { - newnames[category] = strdup (newnames[category]); - if (newnames[category] == NULL) - break; + if (! strcmp (newnames[category], + _nl_current_names[category])) + newnames[category] = _nl_current_names[category]; + else + { + newnames[category] = strdup (newnames[category]); + if (newnames[category] == NULL) + break; + } } } @@ -352,7 +358,8 @@ setlocale (int category, const char *loc } else for (++category; category < __LC_LAST; ++category) - if (category != LC_ALL && newnames[category] != _nl_C_name) + if (category != LC_ALL && newnames[category] != _nl_C_name + && newnames[category] != _nl_current_names[category]) free ((char *) newnames[category]); /* Critical section left. */ --- glibc-2.2.4-cygnus/localedata/SUPPORTED 2001/08/04 17:11:07 1.1.1.13 +++ glibc-2.2.4-redhat/localedata/SUPPORTED 2001/08/04 18:47:21 1.17 @@ -159,3 +159,134 @@ zh_CN.GBK/GBK \ zh_HK/BIG5-HKSCS \ zh_TW/BIG5 \ zh_TW.EUC-TW/EUC-TW \ +ar_AE.UTF-8/UTF-8 \ +ar_BH.UTF-8/UTF-8 \ +ar_DZ.UTF-8/UTF-8 \ +ar_EG.UTF-8/UTF-8 \ +ar_IQ.UTF-8/UTF-8 \ +ar_JO.UTF-8/UTF-8 \ +ar_KW.UTF-8/UTF-8 \ +ar_LB.UTF-8/UTF-8 \ +ar_LY.UTF-8/UTF-8 \ +ar_MA.UTF-8/UTF-8 \ +ar_OM.UTF-8/UTF-8 \ +ar_QA.UTF-8/UTF-8 \ +ar_SA.UTF-8/UTF-8 \ +ar_SD.UTF-8/UTF-8 \ +ar_SY.UTF-8/UTF-8 \ +ar_TN.UTF-8/UTF-8 \ +ar_YE.UTF-8/UTF-8 \ +be_BY.UTF-8/UTF-8 \ +bg_BG.UTF-8/UTF-8 \ +ca_ES.UTF-8/UTF-8 \ +ca_ES.UTF-8@euro/UTF-8 \ +cs_CZ.UTF-8/UTF-8 \ +da_DK.UTF-8/UTF-8 \ +de_AT.UTF-8/UTF-8 \ +de_AT.UTF-8@euro/UTF-8 \ +de_BE.UTF-8/UTF-8 \ +de_BE.UTF-8@euro/UTF-8 \ +de_CH.UTF-8/UTF-8 \ +de_DE.UTF-8/UTF-8 \ +de_DE.UTF-8@euro/UTF-8 \ +de_LU.UTF-8/UTF-8 \ +de_LU.UTF-8@euro/UTF-8 \ +el_GR.UTF-8/UTF-8 \ +en_AU.UTF-8/UTF-8 \ +en_BW.UTF-8/UTF-8 \ +en_CA.UTF-8/UTF-8 \ +en_DK.UTF-8/UTF-8 \ +en_GB.UTF-8/UTF-8 \ +en_HK.UTF-8/UTF-8 \ +en_IE.UTF-8/UTF-8 \ +en_IE.UTF-8@euro/UTF-8 \ +en_NZ.UTF-8/UTF-8 \ +en_PH.UTF-8/UTF-8 \ +en_SG.UTF-8/UTF-8 \ +en_US.UTF-8/UTF-8 \ +en_ZA.UTF-8/UTF-8 \ +en_ZW.UTF-8/UTF-8 \ +es_AR.UTF-8/UTF-8 \ +es_BO.UTF-8/UTF-8 \ +es_CL.UTF-8/UTF-8 \ +es_CO.UTF-8/UTF-8 \ +es_CR.UTF-8/UTF-8 \ +es_DO.UTF-8/UTF-8 \ +es_EC.UTF-8/UTF-8 \ +es_ES.UTF-8/UTF-8 \ +es_ES.UTF-8@euro/UTF-8 \ +es_GT.UTF-8/UTF-8 \ +es_HN.UTF-8/UTF-8 \ +es_MX.UTF-8/UTF-8 \ +es_NI.UTF-8/UTF-8 \ +es_PA.UTF-8/UTF-8 \ +es_PE.UTF-8/UTF-8 \ +es_PR.UTF-8/UTF-8 \ +es_PY.UTF-8/UTF-8 \ +es_SV.UTF-8/UTF-8 \ +es_US.UTF-8/UTF-8 \ +es_UY.UTF-8/UTF-8 \ +es_VE.UTF-8/UTF-8 \ +et_EE.UTF-8/UTF-8 \ +eu_ES.UTF-8/UTF-8 \ +eu_ES.UTF-8@euro/UTF-8 \ +fi_FI.UTF-8/UTF-8 \ +fi_FI.UTF-8@euro/UTF-8 \ +fo_FO.UTF-8/UTF-8 \ +fr_BE.UTF-8/UTF-8 \ +fr_BE.UTF-8@euro/UTF-8 \ +fr_CA.UTF-8/UTF-8 \ +fr_CH.UTF-8/UTF-8 \ +fr_FR.UTF-8/UTF-8 \ +fr_FR.UTF-8@euro/UTF-8 \ +fr_LU.UTF-8/UTF-8 \ +fr_LU.UTF-8@euro/UTF-8 \ +ga_IE.UTF-8/UTF-8 \ +ga_IE.UTF-8@euro/UTF-8 \ +gl_ES.UTF-8/UTF-8 \ +gl_ES.UTF-8@euro/UTF-8 \ +gv_GB.UTF-8/UTF-8 \ +he_IL.UTF-8/UTF-8 \ +hr_HR.UTF-8/UTF-8 \ +hu_HU.UTF-8/UTF-8 \ +id_ID.UTF-8/UTF-8 \ +is_IS.UTF-8/UTF-8 \ +it_CH.UTF-8/UTF-8 \ +it_IT.UTF-8/UTF-8 \ +it_IT.UTF-8@euro/UTF-8 \ +iw_IL.UTF-8/UTF-8 \ +ja_JP.UTF-8/UTF-8 \ +kl_GL.UTF-8/UTF-8 \ +kw_GB.UTF-8/UTF-8 \ +lt_LT.UTF-8/UTF-8 \ +lv_LV.UTF-8/UTF-8 \ +mk_MK.UTF-8/UTF-8 \ +ms_MY.UTF-8/UTF-8 \ +mt_MT.UTF-8/UTF-8 \ +nl_BE.UTF-8/UTF-8 \ +nl_BE.UTF-8@euro/UTF-8 \ +nl_NL.UTF-8/UTF-8 \ +nl_NL.UTF-8@euro/UTF-8 \ +nn_NO.UTF-8/UTF-8 \ +no_NO.UTF-8/UTF-8 \ +pl_PL.UTF-8/UTF-8 \ +pt_BR.UTF-8/UTF-8 \ +pt_PT.UTF-8/UTF-8 \ +pt_PT.UTF-8@euro/UTF-8 \ +ro_RO.UTF-8/UTF-8 \ +ru_RU.UTF-8/UTF-8 \ +ru_UA.UTF-8/UTF-8 \ +sk_SK.UTF-8/UTF-8 \ +sl_SI.UTF-8/UTF-8 \ +sq_AL.UTF-8/UTF-8 \ +sr_YU.UTF-8/UTF-8 \ +sr_YU.UTF-8@cyrillic/UTF-8 \ +sv_FI.UTF-8/UTF-8 \ +sv_FI.UTF-8@euro/UTF-8 \ +sv_SE.UTF-8/UTF-8 \ +th_TH.UTF-8/UTF-8 \ +tr_TR.UTF-8/UTF-8 \ +uk_UA.UTF-8/UTF-8 \ +zh_CN.UTF-8/UTF-8 \ +zh_HK.UTF-8/UTF-8 \ +zh_TW.UTF-8/UTF-8 \ --- glibc-2.2.4-cygnus/malloc/malloc.c 2001/08/22 09:45:21 1.1.1.23 +++ glibc-2.2.4-redhat/malloc/malloc.c 2001/08/22 10:17:19 1.2 @@ -19,7 +19,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -/* $Id: malloc.c,v 1.1.1.23 2001/08/22 09:45:21 jakub Exp $ +/* $Id: malloc.c,v 1.2 2001/08/22 10:17:19 jakub Exp $ This work is mainly derived from malloc-2.6.4 by Doug Lea , which is available from: @@ -2790,6 +2790,7 @@ Void_t* mALLOc(bytes) size_t bytes; #if defined _LIBC || defined MALLOC_HOOKS __malloc_ptr_t (*hook) __MALLOC_PMT ((size_t, __const __malloc_ptr_t)) = __malloc_hook; + asm ("" : "=r" (hook) : "0" (hook)); if (hook != NULL) { Void_t* result; @@ -3115,7 +3116,7 @@ void fREe(mem) Void_t* mem; #if defined _LIBC || defined MALLOC_HOOKS void (*hook) __MALLOC_PMT ((__malloc_ptr_t, __const __malloc_ptr_t)) = __free_hook; - + asm ("" : "=r" (hook) : "0" (hook)); if (hook != NULL) { #if defined __GNUC__ && __GNUC__ >= 2 (*hook)(mem, RETURN_ADDRESS (0)); @@ -3322,6 +3323,7 @@ Void_t* rEALLOc(oldmem, bytes) Void_t* o __malloc_ptr_t (*hook) __MALLOC_PMT ((__malloc_ptr_t, size_t, __const __malloc_ptr_t)) = __realloc_hook; + asm ("" : "=r" (hook) : "0" (hook)); if (hook != NULL) { Void_t* result; @@ -3607,6 +3609,7 @@ Void_t* mEMALIGn(alignment, bytes) size_ __malloc_ptr_t (*hook) __MALLOC_PMT ((size_t, size_t, __const __malloc_ptr_t)) = __memalign_hook; + asm ("" : "=r" (hook) : "0" (hook)); if (hook != NULL) { Void_t* result; @@ -3801,6 +3804,7 @@ Void_t* cALLOc(n, elem_size) size_t n; s #if defined _LIBC || defined MALLOC_HOOKS __malloc_ptr_t (*hook) __MALLOC_PMT ((size_t, __const __malloc_ptr_t)) = __malloc_hook; + asm ("" : "=r" (hook) : "0" (hook)); if (hook != NULL) { sz = n * elem_size; #if defined __GNUC__ && __GNUC__ >= 2 --- glibc-2.2.4-cygnus/malloc/memusage.c 2001/08/16 06:26:56 1.1.1.6 +++ glibc-2.2.4-redhat/malloc/memusage.c 2001/08/16 06:55:48 1.6 @@ -207,7 +207,7 @@ me (void) outname = getenv ("MEMUSAGE_OUTPUT"); if (outname != NULL && outname[0] != '\0' - && (access (outname, R_OK | W_OK) == 0 || errno == ENOENT)) + && (!__libc_enable_secure || access (outname, R_OK | W_OK) == 0)) { fd = creat (outname, 0666); --- glibc-2.2.4-cygnus/nis/Versions 2000/08/03 09:31:37 1.1.1.3 +++ glibc-2.2.4-redhat/nis/Versions 2000/08/03 09:57:53 1.5 @@ -54,6 +54,9 @@ libnsl { __nisbind_destroy; __nisbind_next; readColdStartFile; writeColdStartFile; } + GLIBC_2.1.2 { + xdr_ypall; + } GLIBC_2.2 { xdr_ypall; } --- glibc-2.2.4-cygnus/nis/yp_xdr.c 2000/01/04 16:11:52 1.1.1.1 +++ glibc-2.2.4-redhat/nis/yp_xdr.c 2000/06/26 08:46:39 1.4 @@ -29,6 +29,7 @@ #include #include +#include bool_t xdr_ypstat (XDR *xdrs, ypstat *objp) @@ -301,7 +302,10 @@ xdr_ypbind_setdom (XDR *xdrs, ypbind_set } bool_t -xdr_ypall(XDR *xdrs, struct ypall_callback *incallback) +__xdr_ypall(XDR *xdrs, struct ypall_callback *incallback); + +bool_t +__xdr_ypall(XDR *xdrs, struct ypall_callback *incallback) { struct ypresp_key_val out; char key[YPMAXRECORD], val[YPMAXRECORD]; @@ -343,3 +347,10 @@ xdr_ypall(XDR *xdrs, struct ypall_callba return FALSE; } } + +#if SHLIB_COMPAT (libnsl, GLIBC_2_1_2, GLIBC_2_2) +strong_alias (__xdr_ypall, __xdr_old_ypall); +compat_symbol (libnsl, __xdr_old_ypall, xdr_ypall, GLIBC_2_1_2); +#endif + +versioned_symbol (libnsl, __xdr_ypall, xdr_ypall, GLIBC_2_2); --- glibc-2.2.4-cygnus/nscd/connections.c 2001/07/18 17:26:09 1.1.1.7 +++ glibc-2.2.4-redhat/nscd/connections.c 2001/07/18 17:51:59 1.8 @@ -535,3 +535,17 @@ start_threads (void) nscd_run ((void *) 0); } + +/* Handle the HUP signal which will force a dump of the cache */ +void +sighup_handler (int signum) +{ + /* Prune the password database */ + prune_cache (&dbs[pwddb], LONG_MAX); + + /* Prune the group database */ + prune_cache (&dbs[grpdb], LONG_MAX); + + /* Prune the host database */ + prune_cache (&dbs[hstdb], LONG_MAX); +} --- glibc-2.2.4-cygnus/nscd/nscd.c 2001/07/09 18:57:42 1.1.1.5 +++ glibc-2.2.4-redhat/nscd/nscd.c 2001/07/09 19:42:54 1.6 @@ -105,6 +105,9 @@ static struct argp argp = options, parse_opt, NULL, doc, }; +/* The SIGHUP handler is extern to this file */ +extern void sighup_handler(int signum); + int main (int argc, char **argv) { @@ -155,12 +158,13 @@ main (int argc, char **argv) /* Ignore job control signals. */ signal (SIGTTOU, SIG_IGN); signal (SIGTTIN, SIG_IGN); - signal (SIGTSTP, SIG_IGN); + signal (SIGTSTP, SIG_IGN); } signal (SIGINT, termination_handler); signal (SIGQUIT, termination_handler); signal (SIGTERM, termination_handler); + signal (SIGHUP, sighup_handler); signal (SIGPIPE, SIG_IGN); /* Cleanup files created by a previous `bind'. */ --- glibc-2.2.4-cygnus/nscd/nscd.conf 2000/05/09 11:47:54 1.1.1.2 +++ glibc-2.2.4-redhat/nscd/nscd.conf 2000/07/17 14:10:35 1.2 @@ -23,7 +23,7 @@ # logfile /var/log/nscd.log # threads 6 -# server-user nobody + server-user nscd debug-level 0 enable-cache passwd yes --- glibc-2.2.4-cygnus/nscd/nscd.init 2000/01/04 16:11:52 1.1.1.1 +++ glibc-2.2.4-redhat/nscd/nscd.init 2001/04/08 20:41:59 1.14 @@ -1,13 +1,13 @@ -#!/bin/sh +#!/bin/bash # # nscd: Starts the Name Switch Cache Daemon # -# chkconfig: - 30 80 +# chkconfig: - 30 74 # description: This is a daemon which handles passwd and group lookups \ # for running programs and cache the results for the next \ -# query. You should start this daemon only if you use \ -# slow Services like NIS or NIS+ -# processname: nscd +# query. You should start this daemon if you use \ +# slow naming services like NIS, NIS+, LDAP, or hesiod. +# processname: /usr/sbin/nscd # config: /etc/nscd.conf # @@ -16,7 +16,7 @@ [ -x /usr/sbin/nscd ] || exit 0 # Source function library. -. /etc/rc.d/init.d/functions +. /etc/init.d/functions # nscd does not run on any kernel lower than 2.2.0 because of threading # problems, so we require that in first place. @@ -34,51 +34,78 @@ case $(uname -r) in esac RETVAL=0 +prog=nscd +start () { + secure="" +# for table in passwd group +# do +# if egrep '^'$table':.*nisplus' /etc/nsswitch.conf >/dev/null +# then +# /usr/lib/nscd_nischeck $table || +# secure="$secure -S $table,yes" +# fi +# done + echo -n $"Starting $prog: " + daemon /usr/sbin/nscd $secure + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nscd + return $RETVAL +} + +stop () { + echo -n $"Stopping $prog: " + /usr/sbin/nscd -K + RETVAL=$? + if [ $RETVAL -eq 0 ]; then + rm -f /var/lock/subsys/nscd + # nscd won't be able to remove these if it is running as + # a non-privileged user + rm -f /var/run/nscd.pid + rm -f /var/run/.nscd_socket + success $"$prog shutdown" + else + failure $"$prog shutdown" + fi + echo + return $RETVAL +} + +restart() { + stop + start +} + # See how we were called. case "$1" in start) - secure="" -# for table in passwd group -# do -# if egrep '^'$table':.*nisplus' /etc/nsswitch.conf >/dev/null -# then -# /usr/lib/nscd_nischeck $table || -# secure="$secure -S $table,yes" -# fi -# done - echo -n "Starting Name Switch Cache Daemon: " - daemon nscd $secure + start RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nscd ;; stop) - echo -n "Stopping Name Switch Cache Daemon: " - /usr/sbin/nscd -K + stop RETVAL=$? - if [ $RETVAL -eq 0 ]; then - rm -f /var/lock/subsys/nscd - echo nscd - else - echo - fi ;; - status) + status) status nscd RETVAL=$? ;; - restart) - $0 stop - $0 start + restart) + restart + RETVAL=$? + ;; + condrestart) + [ -e /var/lock/subsys/nscd ] && restart RETVAL=$? ;; - reload) - killproc -HUP nscd + reload) + killproc /usr/sbin/nscd -HUP RETVAL=$? ;; *) - echo "Usage: $0 {start|stop|status|restart}" + echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}" + RETVAL=1 ;; esac exit $RETVAL --- glibc-2.2.4-cygnus/po/Makefile 2001/07/09 18:57:43 1.1.1.4 +++ glibc-2.2.4-redhat/po/Makefile 2001/07/09 19:42:54 1.3 @@ -21,8 +21,8 @@ subdir := po # List of languages that are currently broken (just run msgfmt from -# GNU gettext 0.10.36 on them to see why) -BROKEN_LINGUAS = el +# GNU gettext 0.10.35 on them to see why) +BROKEN_LINGUAS = el zh_TW # List of languages for which we have message catalogs of translations. ALL_LINGUAS := $(filter-out $(BROKEN_LINGUAS),$(basename $(wildcard *.po))) --- glibc-2.2.4-cygnus/sunrpc/rpc_cout.c 2001/01/08 17:59:24 1.1.1.3 +++ glibc-2.2.4-redhat/sunrpc/rpc_cout.c 2001/09/04 11:27:43 1.2 @@ -32,7 +32,7 @@ * From: @(#)rpc_cout.c 1.13 89/02/22 (C) 1987 SMI */ char cout_rcsid[] = -"$Id: rpc_cout.c,v 1.1.1.3 2001/01/08 17:59:24 jakub Exp $"; +"$Id: rpc_cout.c,v 1.2 2001/09/04 11:27:43 jakub Exp $"; /* * rpc_cout.c, XDR routine outputter for the RPC protocol compiler @@ -801,7 +801,7 @@ static char * upcase (const char *str) { char *ptr, *hptr; - ptr = malloc (strlen (str)); + ptr = malloc (strlen (str) + 1); if (ptr == NULL) { f_print (stderr, "malloc failed\n"); --- glibc-2.2.4-cygnus/sunrpc/rpc_main.c 2001/04/11 13:40:55 1.1.1.6 +++ glibc-2.2.4-redhat/sunrpc/rpc_main.c 2001/04/11 14:57:10 1.5 @@ -32,7 +32,7 @@ * From @(#)rpc_main.c 1.30 89/03/30 (C) 1987 SMI; */ const char main_rcsid[] = - "$Id: rpc_main.c,v 1.1.1.6 2001/04/11 13:40:55 jakub Exp $"; + "$Id: rpc_main.c,v 1.5 2001/04/11 14:57:10 jakub Exp $"; /* * rpc_main.c, Top level of the RPC protocol compiler. --- glibc-2.2.4-cygnus/sysdeps/alpha/alphaev6/memcpy.S Tue Sep 4 15:06:47 2001 +++ glibc-2.2.4-redhat/sysdeps/alpha/alphaev6/memcpy.S Thu Aug 24 05:00:32 2000 @@ -1,254 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - EV6 optimized by Rick Gorton . - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* - * Much of the information about 21264 scheduling/coding comes from: - * Compiler Writer's Guide for the Alpha 21264 - * abbreviated as 'CWG' in other comments here - * ftp.digital.com/pub/Digital/info/semiconductor/literature/dsc-library.html - * Scheduling notation: - * E - either cluster - * U - upper subcluster; U0 - subcluster U0; U1 - subcluster U1 - * L - lower subcluster; L0 - subcluster L0; L1 - subcluster L1 - * - * Temp usage notes: - * $0 - destination address - * $1,$2, - scratch - */ - -#include - - .arch ev6 - .set noreorder - .set noat - -ENTRY(memcpy) - - mov $16, $0 # E : copy dest to return - ble $18, $nomoredata # U : done with the copy? - xor $16, $17, $1 # E : are source and dest alignments the same? - and $1, 7, $1 # E : are they the same mod 8? - - bne $1, $misaligned # U : Nope - gotta do this the slow way - /* source and dest are same mod 8 address */ - and $16, 7, $1 # E : Are both 0mod8? - beq $1, $both_0mod8 # U : Yes - nop # E : - - /* - * source and dest are same misalignment. move a byte at a time - * until a 0mod8 alignment for both is reached. - * At least one byte more to move - */ - -$head_align: - ldbu $1, 0($17) # L : grab a byte - subq $18, 1, $18 # E : count-- - addq $17, 1, $17 # E : src++ - stb $1, 0($16) # L : - addq $16, 1, $16 # E : dest++ - and $16, 7, $1 # E : Are we at 0mod8 yet? - ble $18, $nomoredata # U : done with the copy? - bne $1, $head_align # U : - -$both_0mod8: - cmple $18, 127, $1 # E : Can we unroll the loop? - bne $1, $no_unroll # U : - and $16, 63, $1 # E : get mod64 alignment - beq $1, $do_unroll # U : no single quads to fiddle - -$single_head_quad: - ldq $1, 0($17) # L : get 8 bytes - subq $18, 8, $18 # E : count -= 8 - addq $17, 8, $17 # E : src += 8 - nop # E : - - stq $1, 0($16) # L : store - addq $16, 8, $16 # E : dest += 8 - and $16, 63, $1 # E : get mod64 alignment - bne $1, $single_head_quad # U : still not fully aligned - -$do_unroll: - addq $16, 64, $7 # E : Initial (+1 trip) wh64 address - cmple $18, 127, $1 # E : Can we go through the unrolled loop? - bne $1, $tail_quads # U : Nope - nop # E : - -$unroll_body: - wh64 ($7) # L1 : memory subsystem hint: 64 bytes at - # ($7) are about to be over-written - ldq $6, 0($17) # L0 : bytes 0..7 - nop # E : - nop # E : - - ldq $4, 8($17) # L : bytes 8..15 - ldq $5, 16($17) # L : bytes 16..23 - addq $7, 64, $7 # E : Update next wh64 address - nop # E : - - ldq $3, 24($17) # L : bytes 24..31 - addq $16, 64, $1 # E : fallback value for wh64 - nop # E : - nop # E : - - addq $17, 32, $17 # E : src += 32 bytes - stq $6, 0($16) # L : bytes 0..7 - nop # E : - nop # E : - - stq $4, 8($16) # L : bytes 8..15 - stq $5, 16($16) # L : bytes 16..23 - subq $18, 192, $2 # E : At least two more trips to go? - nop # E : - - stq $3, 24($16) # L : bytes 24..31 - addq $16, 32, $16 # E : dest += 32 bytes - nop # E : - nop # E : - - ldq $6, 0($17) # L : bytes 0..7 - ldq $4, 8($17) # L : bytes 8..15 - cmovlt $2, $1, $7 # E : Latency 2, extra map slot - Use - # fallback wh64 address if < 2 more trips - nop # E : - - ldq $5, 16($17) # L : bytes 16..23 - ldq $3, 24($17) # L : bytes 24..31 - addq $16, 32, $16 # E : dest += 32 - subq $18, 64, $18 # E : count -= 64 - - addq $17, 32, $17 # E : src += 32 - stq $6, -32($16) # L : bytes 0..7 - stq $4, -24($16) # L : bytes 8..15 - cmple $18, 63, $1 # E : At least one more trip? - - stq $5, -16($16) # L : bytes 16..23 - stq $3, -8($16) # L : bytes 24..31 - nop # E : - beq $1, $unroll_body - -$tail_quads: -$no_unroll: - .align 4 - subq $18, 8, $18 # E : At least a quad left? - blt $18, $less_than_8 # U : Nope - nop # E : - nop # E : - -$move_a_quad: - ldq $1, 0($17) # L : fetch 8 - subq $18, 8, $18 # E : count -= 8 - addq $17, 8, $17 # E : src += 8 - nop # E : - - stq $1, 0($16) # L : store 8 - addq $16, 8, $16 # E : dest += 8 - bge $18, $move_a_quad # U : - nop # E : - -$less_than_8: - .align 4 - addq $18, 8, $18 # E : add back for trailing bytes - ble $18, $nomoredata # U : All-done - nop # E : - nop # E : - - /* Trailing bytes */ -$tail_bytes: - subq $18, 1, $18 # E : count-- - ldbu $1, 0($17) # L : fetch a byte - addq $17, 1, $17 # E : src++ - nop # E : - - stb $1, 0($16) # L : store a byte - addq $16, 1, $16 # E : dest++ - bgt $18, $tail_bytes # U : more to be done? - nop # E : - - /* branching to exit takes 3 extra cycles, so replicate exit here */ - ret $31, ($26), 1 # L0 : - nop # E : - nop # E : - nop # E : - -$misaligned: - mov $0, $4 # E : dest temp - and $0, 7, $1 # E : dest alignment mod8 - beq $1, $dest_0mod8 # U : life doesnt totally suck - nop - -$aligndest: - ble $18, $nomoredata # U : - ldbu $1, 0($17) # L : fetch a byte - subq $18, 1, $18 # E : count-- - addq $17, 1, $17 # E : src++ - - stb $1, 0($4) # L : store it - addq $4, 1, $4 # E : dest++ - and $4, 7, $1 # E : dest 0mod8 yet? - bne $1, $aligndest # U : go until we are aligned. - - /* Source has unknown alignment, but dest is known to be 0mod8 */ -$dest_0mod8: - subq $18, 8, $18 # E : At least a quad left? - blt $18, $misalign_tail # U : Nope - ldq_u $3, 0($17) # L : seed (rotating load) of 8 bytes - nop # E : - -$mis_quad: - ldq_u $16, 8($17) # L : Fetch next 8 - extql $3, $17, $3 # U : masking - extqh $16, $17, $1 # U : masking - bis $3, $1, $1 # E : merged bytes to store - - subq $18, 8, $18 # E : count -= 8 - addq $17, 8, $17 # E : src += 8 - stq $1, 0($4) # L : store 8 (aligned) - mov $16, $3 # E : "rotate" source data - - addq $4, 8, $4 # E : dest += 8 - bge $18, $mis_quad # U : More quads to move - nop - nop - -$misalign_tail: - addq $18, 8, $18 # E : account for tail stuff - ble $18, $nomoredata # U : - nop - nop - -$misalign_byte: - ldbu $1, 0($17) # L : fetch 1 - subq $18, 1, $18 # E : count-- - addq $17, 1, $17 # E : src++ - nop # E : - - stb $1, 0($4) # L : store - addq $4, 1, $4 # E : dest++ - bgt $18, $misalign_byte # U : more to go? - nop - - -$nomoredata: - ret $31, ($26), 1 # L0 : - nop # E : - nop # E : - nop # E : - -END(memcpy) --- glibc-2.2.4-cygnus/sysdeps/generic/ldsodefs.h 2001/08/27 07:58:25 1.1.1.22 +++ glibc-2.2.4-redhat/sysdeps/generic/ldsodefs.h 2001/08/27 08:48:41 1.5 @@ -193,6 +193,8 @@ extern const char *_dl_profile; extern struct link_map *_dl_profile_map; /* Filename of the output file. */ extern const char *_dl_profile_output; +/* Map of shared object to be prelink traced. */ +extern struct link_map *_dl_trace_prelink_map; /* If nonzero the appropriate debug information is printed. */ extern int _dl_debug_mask; @@ -204,6 +206,7 @@ extern int _dl_debug_mask; #define DL_DEBUG_RELOC (1 << 5) #define DL_DEBUG_FILES (1 << 6) #define DL_DEBUG_STATISTICS (1 << 7) +#define DL_DEBUG_PRELINK (1 << 8) /* Expect cache ID. */ extern int _dl_correct_cache_id; @@ -420,6 +423,11 @@ extern void _dl_reloc_bad_type (struct l uint_fast8_t type, int plt) internal_function __attribute__ ((__noreturn__)); + +/* Resolve conflicts if prelinking. */ +extern void _dl_resolve_conflicts (struct link_map *l, + ElfW(Rela) *conflict, + ElfW(Rela) *conflictend); /* Check the version dependencies of all objects available through MAP. If VERBOSE print some more diagnostics. */ --- glibc-2.2.4-cygnus/sysdeps/i386/dl-machine.h 2001/09/01 09:14:31 1.1.1.15 +++ glibc-2.2.4-redhat/sysdeps/i386/dl-machine.h 2001/09/03 12:55:51 1.6 @@ -87,6 +87,14 @@ elf_machine_runtime_setup (struct link_m offset into the .rel.plt section, push _GLOBAL_OFFSET_TABLE_[1], and then jump to _GLOBAL_OFFSET_TABLE[2]. */ got = (Elf32_Addr *) D_PTR (l, l_info[DT_PLTGOT]); + /* If a library is prelinked but we have to relocate anyway, + we have to be able to undo the prelinking of .got.plt. + The prelinker saved us here address of .plt + 0x16. */ + if (got[1]) + { + l->l_mach.plt = got[1] + l->l_addr; + l->l_mach.gotplt = (Elf32_Addr) &got[3]; + } got[1] = (Elf32_Addr) l; /* Identify this shared object. */ /* The got[2] entry contains the address of a function which gets @@ -258,8 +266,9 @@ _dl_start_user:\n\ /* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */ #define ELF_MACHINE_JMP_SLOT R_386_JMP_SLOT -/* The i386 never uses Elf32_Rela relocations. */ -#define ELF_MACHINE_NO_RELA 1 +/* The i386 never uses Elf32_Rela relocations for the dynamic linker. + Prelinked libraries may use Elf32_Rela though. */ +#define ELF_MACHINE_PLT_REL 1 /* We define an initialization functions. This is called very early in _dl_sysdep_start. */ @@ -295,6 +304,12 @@ elf_machine_plt_value (struct link_map * #ifdef RESOLVE +/* The i386 never uses Elf32_Rela relocations for the dynamic linker. + Prelinked libraries may use Elf32_Rela though. */ +#ifdef RTLD_BOOTSTRAP +#define ELF_MACHINE_NO_RELA 1 +#endif + /* Perform the relocation specified by RELOC and SYM (which is fully resolved). MAP is the object containing the reloc. */ @@ -378,6 +393,41 @@ elf_machine_rel (struct link_map *map, c } } +#ifndef RTLD_BOOTSTRAP +static inline void +elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, + const Elf32_Sym *sym, const struct r_found_version *version, + Elf32_Addr *const reloc_addr) +{ + if (ELF32_R_TYPE (reloc->r_info) == R_386_RELATIVE) + *reloc_addr = map->l_addr + reloc->r_addend; + else if (ELF32_R_TYPE (reloc->r_info) != R_386_NONE) + { +/* const Elf32_Sym *const refsym = sym; */ + Elf32_Addr value = RESOLVE (&sym, version, ELF32_R_TYPE (reloc->r_info)); + if (sym) + value += sym->st_value; + + switch (ELF32_R_TYPE (reloc->r_info)) + { + case R_386_GLOB_DAT: + case R_386_JMP_SLOT: + case R_386_32: + *reloc_addr = value + reloc->r_addend; + break; + case R_386_PC32: + *reloc_addr = (value + reloc->r_addend - (Elf32_Addr) reloc_addr); + break; + default: + /* We add these checks in the version to relocate ld.so only + if we are still debugging. */ + _dl_reloc_bad_type (map, ELFW(R_TYPE) (reloc->r_info), 0); + break; + } + } +} +#endif + static inline void elf_machine_rel_relative (Elf32_Addr l_addr, const Elf32_Rel *reloc, Elf32_Addr *const reloc_addr) @@ -386,6 +436,15 @@ elf_machine_rel_relative (Elf32_Addr l_a *reloc_addr += l_addr; } +#ifndef RTLD_BOOTSTRAP +static inline void +elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc, + Elf32_Addr *const reloc_addr) +{ + *reloc_addr = l_addr + reloc->r_addend; +} +#endif + static inline void elf_machine_lazy_rel (struct link_map *map, Elf32_Addr l_addr, const Elf32_Rel *reloc) @@ -394,9 +453,26 @@ elf_machine_lazy_rel (struct link_map *m const unsigned int r_type = ELF32_R_TYPE (reloc->r_info); /* Check for unexpected PLT reloc type. */ if (__builtin_expect (r_type == R_386_JMP_SLOT, 1)) - *reloc_addr += l_addr; + { + if (__builtin_expect (map->l_mach.plt, 0) == 0) + *reloc_addr += l_addr; + else + *reloc_addr = + map->l_mach.plt + + (((Elf32_Addr) reloc_addr) - map->l_mach.gotplt) * 4; + } else _dl_reloc_bad_type (map, r_type, 1); } + +#ifndef RTLD_BOOTSTRAP + +static inline void +elf_machine_lazy_rela (struct link_map *map, + Elf32_Addr l_addr, const Elf32_Rela *reloc) +{ +} + +#endif #endif /* RESOLVE */ --- glibc-2.2.4-cygnus/sysdeps/i386/bits/link.h Thu Aug 24 05:00:32 2000 +++ glibc-2.2.4-redhat/sysdeps/i386/bits/link.h Tue Sep 4 15:06:49 2001 @@ -0,0 +1,5 @@ +struct link_map_machine + { + Elf32_Addr plt; /* Address of .plt + 0x16 */ + Elf32_Addr gotplt; /* Address of .got + 0x0c */ + }; --- glibc-2.2.4-cygnus/sysdeps/i386/fpu/bits/mathinline.h 2001/07/09 18:58:07 1.1.1.10 +++ glibc-2.2.4-redhat/sysdeps/i386/fpu/bits/mathinline.h 2001/07/09 19:42:56 1.8 @@ -381,7 +381,8 @@ __sincosl (long double __x, long double ("fscale # 2^int(x * log2(e))\n\t" \ : "=t" (__temp) : "0" (1.0), "u" (__exponent)); \ __temp -= 1.0; \ - return __temp + __value ?: __x + __temp += __value; \ + return __temp ? __temp : __x __inline_mathcodeNP_ (long double, __expm1l, __x, __expm1_code) --- glibc-2.2.4-cygnus/sysdeps/sparc/sparc32/sparcv9/Makefile 2001/04/11 13:41:46 1.1.1.2 +++ glibc-2.2.4-redhat/sysdeps/sparc/sparc32/sparcv9/Makefile 2001/04/11 14:57:13 1.4 @@ -1,14 +1,12 @@ -sysdep-CFLAGS += -mcpu=v8 -mtune=ultrasparc -Wa,-Av9a +sysdep-CFLAGS += -mcpu=ultrasparc -Wa,-Av9a ifeq ($(subdir),csu) sysdep_routines += hp-timing endif -ifeq ($(subst gnulib,string,$(subdir)),string) ASFLAGS-.o += -Wa,-Av9a ASFLAGS-.os += -Wa,-Av9a ASFLAGS-.op += -Wa,-Av9a ASFLAGS-.og += -Wa,-Av9a ASFLAGS-.ob += -Wa,-Av9a ASFLAGS-.oS += -Wa,-Av9a -endif --- glibc-2.2.4-cygnus/sysdeps/unix/sysv/linux/paths.h 2000/11/18 00:03:05 1.1.1.2 +++ glibc-2.2.4-redhat/sysdeps/unix/sysv/linux/paths.h 2000/11/18 00:20:14 1.4 @@ -61,7 +61,7 @@ #define _PATH_TTY "/dev/tty" #define _PATH_UNIX "/boot/vmlinux" #define _PATH_UTMP "/var/run/utmp" -#define _PATH_VI "/usr/bin/vi" +#define _PATH_VI "/bin/vi" #define _PATH_WTMP "/var/log/wtmp" /* Provide trailing slash, since mostly used for building pathnames. */ --- glibc-2.2.4-cygnus/sysdeps/unix/sysv/linux/alpha/gethostname.c Thu Aug 24 05:00:32 2000 +++ glibc-2.2.4-redhat/sysdeps/unix/sysv/linux/alpha/gethostname.c Tue Sep 4 15:06:52 2001 @@ -0,0 +1,49 @@ +/* Copyright (C) 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 2001 + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include +#include +#include + +#include +#include +#include + +extern int __syscall_gethostname (char *name, size_t len); + +int +__gethostname (char *name, size_t len) +{ + int result; + + result = INLINE_SYSCALL (gethostname, 2, CHECK_N (name, len), len); + + if (result == 0 + /* See whether the string is terminated. If not we will return + an error. */ + && memchr (name, '\0', len) == NULL) + { + __set_errno (EOVERFLOW); + result = -1; + } + + return result; +} + +weak_alias (__gethostname, gethostname)