2002-02-03 Andreas Schwab <schwab@suse.de>
* sysdeps/posix/readv.c: Use ssize_t for bytes_read.
* sysdeps/posix/writev.c: Use ssize_t for bytes_written. Fix comment.
2002-02-03 Thorsten Kukuk <kukuk@suse.de>
* sysdeps/posix/writev.c: Check for ssize_t overflow, don't use
alloca if the memory reqirements are too high.
2002-02-03 Ulrich Drepper <drepper@redhat.com>
* elf/dl-load.c (decompose_rpath): Avoid using strstr.
* elf/dl-minimal.c (_strerror_r): Use _itoa instead of _itoa_word since
the former is available anyway and speed isn't important here.
* elf/dl-misc.c (_dl_debug_vdprintf): Likewise.
* elf/dl-version.c (match_symbol): Likewise.
(_dl_check_map_versions): Likewise.
* elf/rtld.c (process_envvars): Likewise.
(print_statistics): Likewise.
* sysdeps/generic/dl-sysdep.c (_dl_show_auxv): Likewise.
* elf/dl-minimal.c (_itoa): Always define it. Make it work for all
bases. Add assert to catch uses of unimplemented features.
(__strsep): Add assert to catch uses of unimplemented features.
* elf/dl-object.c (_dl_new_object): Don't use rawmemchr. Use strchr
and avoid inline optimization.
* elf/rtld.c (process_envvars): Likewise.
* elf/dl-open.c: Don't include <stdio-common/_itoa.h>.
* elf/dl-profile.c (_dl_start_profile): Help compiler to avoid ffs.
* elf/rtld.c (dl_main): Avoid strsep inline optimization.
* stdio-common/_itoa.h: Minor simplifications of the code.
* stdio-common/_itoa.c: Likewise.
* elf/dl-reloc.c (_dl_relocate_object): Use _dl_debug_printf
instead of _dl_printf for debugging info output.
* sysdeps/mips/atomicity.h (exchange_and_add): Use branch likely.
2001-12-11 Jakub Jelinek <jakub@redhat.com>
* elf/Makefile (dl-routines): Add conflict.
(rtld-ldscript-in, rtld-ldscript, rtld-parms): Remove.
(ld.so): Add _begin local symbol.
* elf/elf.h (DT_VALTAGIDX, DT_VALNUM, DT_ADDRTAGIDX, DT_ADDRNUM):
Define.
* elf/dl-deps.c (_dl_build_local_scope): New.
(_dl_map_object_deps): If LD_TRACE_PRELINKING, compute local scopes
of all libraries.
* elf/do-rel.h (VALIDX): Define.
(elf_dynamic_do_rel): If ELF_MACHINE_PLT_REL is defined, don't do
lazy binding for RELA. If DT_GNU_PRELINKED, DT_RELACOUNT relocations
can be skipped.
* elf/dl-conflict.c: New file.
* elf/dl-lookup.c (_dl_debug_bindings): New.
(_dl_lookup_symbol): Use _dl_debug_bindings. Reference_name is always
non-NULL.
(_dl_lookup_symbol_skip): Likewise.
(_dl_lookup_versioned_symbol): Likewise.
(_dl_lookup_versioned_symbol_skip): Likewise.
* elf/dl-runtime.c (PLTREL): If ELF_MACHINE_PLT_REL is defined,
define to ElfW(Rel).
* elf/dynamic-link.h (elf_get_dynamic_info): Record selected dynamic
tags in the DT_VALRNGLO..DT_VALRNGHI and DT_ADDRRNGLO..DT_ADDRRNGHI
ranges.
Don't adjust address dynamic tags if l_addr is 0.
* elf/rtld.c (_dl_trace_prelink, _dl_trace_prelink_map): New variables.
(_dl_start): Skip ELF_DYNAMIC_RELOCATE if ld.so is prelinked.
(VALIDX, ADDRIDX): Define.
(_dl_start_final): Initialize _dl_rtld_map's l_map_start and l_map_end.
(dl_main): Print library list for LD_TRACE_PRELINKING.
If prelinking information can be used, skip relocating libraries and
call _dl_resolve_conflicts instead.
(process_envvars): Handle LD_TRACE_PRELINKING envvar.
* elf/dl-load.c (_dl_map_object): Don't create fake libs
if LD_TRACE_PRELINKING.
* include/link.h (struct link_map) [l_info]: Add DT_VALNUM
+ DT_ADDRNUM.
* sysdeps/generic/ldsodefs.h (_dl_trace_prelink_map): New declaration.
(DL_DEBUG_PRELINK): Define.
(_dl_resolve_conflicts): Add prototype.
* sysdeps/alpha/dl-machine.h (elf_machine_runtime_setup): Reinitialize
.plt for prelinked libraries where prelinking info cannot be used.
(elf_machine_rela): If relocating R_ALPHA_JMP_SLOT in .gnu.conflict
section, use RESOLVE_CONFLICT_FIND_MAP to find out reloc's link_map.
* sysdeps/arm/bits/link.h: New file.
* sysdeps/arm/dl-machine.h (elf_machine_runtime_setup): Save original
content of .got[1].
(ELF_MACHINE_NO_RELA): Only define if RTLD_BOOTSTRAP.
(ELF_MACHINE_PLT_REL): Define.
(elf_machine_rela, elf_machine_rela_relative): New.
(elf_machine_lazy_rel): Reinitialize R_ARM_JUMP_SLOT address instead
of adjusting it if prelinked and prelinking cannot be used.
* sysdeps/i386/bits/link.h: New file.
* sysdeps/i386/dl-machine.h (elf_machine_runtime_setup): Save original
content of .got[1].
(ELF_MACHINE_NO_RELA): Only define if RTLD_BOOTSTRAP.
(ELF_MACHINE_PLT_REL): Define.
(elf_machine_rela, elf_machine_rela_relative): New.
(elf_machine_lazy_rel): Reinitialize R_386_JUMP_SLOT address instead
of adjusting it if prelinked and prelinking cannot be used.
* sysdeps/powerpc/dl-machine.h (elf_machine_rela): If relocating
conflicts, skip finaladdr computation. Use RESOLVE_CONFLICT_FIND_MAP
to find out map for R_PPC_JMP_SLOT relocs.
* sysdeps/sparc/sparc32/dl-machine.h (VALIDX): Define.
(OPCODE_BA): Define.
(elf_machine_runtime_setup): Reinitialize .plt for prelinked
libraries where prelinking info cannot be used.
(sparc_fixup_plt): Renamed from elf_machine_fixup_plt.
(elf_machine_fixup_plt): Call sparc_fixup_plt.
(elf_machine_rela): Set value to 0 if relocating conflicts.
Call sparc_fixup_plt for R_SPARC_JMP_SLOT.
* sysdeps/sparc/sparc64/dl-machine.h (VALIDX): Define.
(sparc64_fixup_plt): Fix a typo.
(elf_machine_rela): Set value to 0 if relocating conflicts.
Handle R_SPARC_JMP_SLOT relocs when relocating conflicts.
(elf_machine_runtime_setup): Reinitialize .plt for prelinked
libraries where prelinking info cannot be used.
* sysdeps/sh/bits/link.h: New file.
* sysdeps/sh/dl-machine.h (elf_machine_runtime_setup): Save original
content of .got[1].
(elf_machine_lazy_rel): Reinitialize R_SH_JMP_SLOT address instead
of adjusting it if prelinked and prelinking cannot be used.
* sysdeps/s390/s390-32/bits/link.h: New file.
* sysdeps/s390/s390-32/dl-machine.h (elf_machine_runtime_setup):
Save original content of .got[1].
(elf_machine_lazy_rel): Reinitialize R_390_JMP_SLOT address instead
of adjusting it if prelinked and prelinking cannot be used.
* sysdeps/s390/s390-64/bits/link.h: New file.
* sysdeps/s390/s390-64/dl-machine.h (elf_machine_runtime_setup):
Save original content of .got[1].
(elf_machine_lazy_rel): Reinitialize R_390_JMP_SLOT address instead
of adjusting it if prelinked and prelinking cannot be used.
* sysdeps/x86_64/bits/link.h: New file.
* sysdeps/x86_64/dl-machine.h (elf_machine_runtime_setup):
Save original content of .got[1].
(elf_machine_lazy_rel): Reinitialize R_X86_64_JMP_SLOT address instead
of adjusting it if prelinked and prelinking cannot be used.
2001-11-09 Ulrich Drepper <drepper@redhat.com>
* elf/dl-minimal.c (realloc): Handle NULL for first parameter
correctly.
* elf/dl-load.c (is_dst): New function.
(_dl_dst_count): Use is_dst to check for DST variable.
(_dl_dst_substitute): Likewise.
2001-11-09 Ulrich Drepper <drepper@redhat.com>
* elf/dl-load.c (_dl_map_object_from_fd): Delete code to remove
from object list when DF_1_NOOPEN is seen. This is done in lose.
2001-11-06 Ulrich Drepper <drepper@redhat.com>
* elf/dl-load.c (_dl_map_object_from_fd): Don't call
_dl_signal_error directly, always use lose. Set fd to -1 after
file is closed.
(lose): Don't call close if fd == -1.
2001-11-01 Ulrich Drepper <drepper@redhat.com>
* elf/dl-load.c (_dl_map_object): Correct test of DF_1_NODEFLIB
for rtld_search_dirs content. Minor optimizations.
2001-10-31 Ulrich Drepper <drepper@redhat.com>
* elf/dl-load.c (_dl_map_object): Make code a bit more compact by
avoiding unnecessary duplication.
2001-10-31 Jakub Jelinek <jakub@redhat.com>
* elf/dl-load.c (_dl_map_object): If library was found using
LD_LIBRARY_PATH, don't try RUNPATH list.
2001-10-29 Kevin Ryde <user42@zip.com.au>
2001-09-08 Ulrich Drepper <drepper@redhat.com>
* elf/dl-object.c: Avoid allocating extra memory block for name.
* elf/dl-close.c (_dl_close): Don't free l_libname if it is no
allocated separately.
* elf/dl-load.c (_dl_map_object_from_fd): Likewise.
* elf/dl-open.c (add_to_global): Remove stale comment.
* elf/dl-load.c (fillin_rpath): In SUID binaries, don't mark
non-system-dirs in LD_LIBRARY_PATH as nonexisting, simply drop them.
2001-07-06 Paul Eggert <eggert@twinsun.com>
* manual/argp.texi: Remove ignored LGPL copyright notice; it's
not appropriate for documentation anyway.
* manual/libc-texinfo.sh: "Library General Public License" ->
"Lesser General Public License".
2001-07-06 Andreas Jaeger <aj@suse.de>
* All files under GPL/LGPL version 2: Place under LGPL version
2.1.
2001-03-12 Jakub Jelinek <jakub@redhat.com>
* csu/Makefile (abi-tag.h): Define OS and version separately, allow
version to be overriden from config.h.
* csu/abi-note.S: Use OS and version separately, include config.h.
* elf/dl-load.c (_dl_osversion): New.
(_dl_map_object_from_fd): Kill some warnings.
(open_verify): Check .note.ABI-tag of the library if present.
* elf/Makefile (CPPFLAGS-dl-load.c): Add -I$(csu-objpfx).
* elf/cache.c (struct cache_entry): Add osversion.
(print_entry): Print osversion.
(print_cache): Pass osversion to it.
(compare): Sort according to osversion.
(save_cache): Set osversion.
(add_to_cache): Add osversion argument.
* sysdeps/generic/ldconfig.h (add_to_cache, process_file,
process_elf_file): Add osversion argument.
* elf/readlib.c (process_file): Likewise.
* sysdeps/generic/readelflib.c (process_elf_file): Likewise.
* sysdeps/unix/sysv/linux/ia64/readelflib.c (process_elf_file,
process_elf32_file, process_elf64_file): Likewise.
* sysdeps/unix/sysv/linux/i386/readelflib.c (process_elf_file,
process_elf32_file, process_elf64_file): Likewise.
* sysdeps/unix/sysv/linux/sparc/readelflib.c (process_elf_file,
process_elf32_file, process_elf64_file): Likewise.
* elf/ldconfig.c (manual_link): Pass it.
(search_dir): Issue diagnostic if two libs with the same soname in
the same directory have different .note.ABI-tag. Record osversion in
dlib_entry and use it from there.
(struct lib_entry): Remove.
(struct dlib_entry): Add osversion.
* sysdeps/generic/dl-cache.c (_dl_load_cache_lookup): Check
osversion.
* sysdeps/generic/dl-cache.h (struct file_entry_new): Replace __unused
field with osversion.
* sysdeps/generic/ldsodefs.h (_dl_osversion): Declare.
* sysdeps/unix/sysv/linux/init-first.c: Include ldsodefs.h.
* sysdeps/unix/sysv/linux/dl-osinfo.h (DL_SYSDEP_OSCHECK): Save kernel
version in _dl_osversion.
* sysdeps/unix/sysv/linux/configure.in: Define __ABI_TAG_VERSION.
* Makerules (build-shlib-helper, build-module-helper): New.
(build-shlib, build-module-helper): Make sure .note.ABI-tag comes
early.
* config.h.in (__ABI_TAG_VERSION): Add.
* elf/dl-minimal.c (__strtoul_internal): Set endptr on return.
* sysdeps/unix/sysv/linux/i386/dl-librecon.h (EXTRA_LD_ENVVARS):
Handle LD_ASSUME_KERNEL.
* sysdeps/unix/sysv/linux/dl-librecon.h: New.
2001-02-01 Ulrich Drepper <drepper@redhat.com>
* Makerules (build-shlib): Add $(extra-B-$(@F:lib%.so=%).so).
* configure.in: Test for -z initfirst linker option.
* config.make.in: Add have-z-initfirst.
* elf/dl-init.c (_dl_init): Split out actual initialization code in
new function call_init. If _dl_initfirst is non-NULL initialize first.
* elf/dl-load.c (_dl_map_from_fd): If DF_1_INITFIRST flag is set
remember object in _dl_initfirst.
* elf/soinit.c: Remove special support for calling
__pthread_initialize_minimal.
* conform/conformtest.pl: Add missing $prepend in type test.
* elf/elf.h (SHT_CHECKSUM): New definition.
* posix/tst-fnmatch.input: Add tests for [. .] in locales.
2000-12-08 Jakub Jelinek <jakub@redhat.com>
* elf/dl-load.c (fillin_rpath): Don't assume there is '\0' at
cp + len. Compute where from dirname.
Reported by <jreiser@BitWagon.com>.
2000-12-08 Richard Henderson <rth@twiddle.net>
* sysdeps/alpha/_mcount.S: Fix typo.
* sysdeps/alpha/strncpy.S: Likewise.
* sysdeps/alpha/alphaev6/Implies: New file.
* sysdeps/alpha/alphaev67/Implies: New file.
* sysdeps/alpha/alphaev67/ffs.S: New file.
* sysdeps/alpha/alphaev67/ffsll.S: New file.
* sysdeps/alpha/alphaev67/rawmemchr.S: New file.
* sysdeps/alpha/alphaev67/stpcpy.S: New file.
* sysdeps/alpha/alphaev67/stpncpy.S: New file.
* sysdeps/alpha/rawmemchr.S: New file.
* sysdeps/alpha/strcat.S: Tail call to __stxcpy.
* sysdeps/alpha/strcpy.S: Likewise.
From GMP 3.1.1:
* sysdeps/alpha/alphaev6/addmul_1.s: New file.
From rick.gorton@alpha-processor.com:
* sysdeps/alpha/alphaev6/memchr.S: New file.
* sysdeps/alpha/alphaev6/memcpy.S: New file.
* sysdeps/alpha/alphaev6/memset.S: New file.
* sysdeps/alpha/alphaev6/stxcpy.S: New file.
* sysdeps/alpha/alphaev6/stxncpy.S: New file.
* sysdeps/alpha/alphaev67/strcat.S: New file.
* sysdeps/alpha/alphaev67/strchr.S: New file.
* sysdeps/alpha/alphaev67/strlen.S: New file.
* sysdeps/alpha/alphaev67/strncat.S: New file.
* sysdeps/alpha/htonl.S: Use a shorter sequence.
2000-12-08 Jakub Jelinek <jakub@redhat.com>
* inet/getnameinfo.c (getnameinfo): Fix NI_NOFQDN support.
Reported by <pspencer@fields.utoronto.ca>.
2000-12-07 Jes Sorensen <jes@linuxcare.com>
* sysdeps/ia64/elf/start.S (__data_start): Add __data_start variable.
Pointed out by Hans Boehm.
2000-12-07 H.J. Lu <hjl@gnu.org>
* elf/dl-version.c (match_symbol): Check map->l_name[0] for printing.
2000-12-07 Andreas Jaeger <aj@suse.de>
* misc/error.c: Add format attributes for __error and __error_at_line.
* nscd/dbg_log.h: Add format attribute.
2000-12-08 Ulrich Drepper <drepper@redhat.com>
* misc/sys/syslog.h: Add format attributes to syslog and vsyslog.
Patch by Joseph S. Myers <jsm28@cam.ac.uk>.
* sysdeps/generic/dl-cache.c (HWCAP_CHECK): Fix access to _dl_hwcap.
* manual/install.texi: Recommend to set LANGUAGE=C LC_ALL=C during
2000-10-28 Ulrich Drepper <drepper@redhat.com>
* elf/dl-load.c (open_verify): Only try to load ET_DYN and ET_EXEC
objects. Reject all other types.
(_dl_map_object_from_fd): Optimize a bit.
2000-10-24 Ulrich Drepper <drepper@redhat.com>
Complete revamp of the reference counter handling.
* include/link.h (struct link_map): Add l_idx field.
* elf/dl-close.c: Handle decrementing of reference counters more
correctly. If necessary decrement reference counters of dependencies
of dependencies.
* elf/dl-lookup.c (add_dependency): Only increment reference counter
of the object itself and not also its dependencies.
* elf/dl-open.c: Increment reference counters here.
* elf/dl-deps.c: Remove reference counter handling here.
* elf/dl-load.c: Likewise.
* elf/rtld.c: Adjust for _dl_map_deps not handling reference counters.
* elf/loadtest.c: Print loaded objects at the beginning.
* include/link.h (struct link_map): New bit field l_faked.
* elf/dl-deps.c: Use l_faked field in struct link_map instead of
the magic l_opencount==0.
* elf/dl-load.c: Likewise.
* elf/dl-version.c: Likewise.
* elf/rtld.c: Likewise.
* elf/dl-load.c (_dl_map_object_from_fd): Split out ELF file
verification in open_verify.
(open_verify): New function. Called instead of open. Ignores valid
files for other architectures.
(open_path): Call open_verify instead of open.
(_dl_map_object): Likewise.
Somewhat based on a patch by Don Dugger <n0ano@valinux.com>.
* io/pwd.c (main): The output was missing a newline.
* include/link.h (struct link_map): Add l_soname_added bitfield.
* elf/dl-load.c (_dl_map_object): Remember when we added the
SONAME to the l_libname list and don't try it again.
* elf/dl-close.c: Decrement opencount for all dependencies which can
be removed even if the object is not yet unloaded.
* elf/dl-deps.c (_dl_map_object_deps): If dependency is already in
the list decrement opencount of all dependencies.
* elf/dl-load.c (_dl_map_object_from_fd): Increment object of object
and all dependencies.
(_dl_map_object): Likewise.
* elf/dl-lookup.c (add_dependency): Likewise.
* elf/loadtest.c: Add debug when with more output.
2000-10-19 H.J. Lu <hjl@gnu.org>
* elf/Makefile (distribute): Add neededtest.c, neededobj1.c,
neededobj2.c and neededobj3.c.
(tests): Add neededtest.
(modules-names): Add neededobj1, neededobj2 and neededobj3.
($(objpfx)neededobj1.so): New target.
($(objpfx)neededobj2.so): Likewise.
($(objpfx)neededobj3.so): Likewise.
($(objpfx)neededtest): Likewise.
($(objpfx)neededtest.out): Likewise.
* elf/neededtest.c: New. Based on the bug report from
Allen Bauer <kylix_rd@hotmail.com>.
* elf/neededobj1.c: Likewise.
* elf/neededobj2.c: Likewise.
* elf/neededobj3.c: Likewise.
2000-10-20 Ulrich Drepper <drepper@redhat.com>
* elf/dl-close.c (_dl_close): Decrement reference counter for all
dependencies even if the DSO does not get unloaded.
* elf/dl-load.c (_dl_map_object_from_fd): Pass pointer to ELF header
to elf_machine_matches_host.
* sysdeps/alpha/dl-machine.h (elf_machine_matches_host): Parameter
is now pointer to ELF header.
* sysdeps/arm/dl-machine.h: Likewise.
* sysdeps/generic/dl-machine.h: Likewise.
* sysdeps/hppa/dl-machine.h: Likewise.
* sysdeps/i386/dl-machine.h: Likewise.
* sysdeps/ia64/dl-machine.h: Likewise.
* sysdeps/m68k/dl-machine.h: Likewise.
* sysdeps/mips/dl-machine.h: Likewise.
* sysdeps/mips/mips64/dl-machine.h: Likewise.
* sysdeps/powerpc/dl-machine.h: Likewise.
* sysdeps/s390/dl-machine.h: Likewise.
* sysdeps/sh/dl-machine.h: Likewise.
* sysdeps/sparc/sparc32/dl-machine.h: Likewise.
* sysdeps/sparc/sparc64/dl-machine.h: Likewise.
Patch by Martin Schwidefsksy <schwidefsky@de.ibm.com>.
2000-10-20 Jakub Jelinek <jakub@redhat.com>
* include/limits.h: Include bits/wordsize.h, use #if __WORDSIZE == 64
check instead of #ifdef __alpha__.
* include/bits/xopen_lim.h (WORD_BIT, LONG_BIT): Don't count on
INT_MAX, __INT_MAX__, LONG_MAX or __LONG_MAX__ being defined when
this is included.
* posix/wordexp-tst.sh (testout): Place output file in build
directory. Patch by Joseph S. Myers <jsm28@cam.ac.uk>.
2000-09-16 Jakub Jelinek <jakub@redhat.com>
* sysdeps/ia64/Implies: Reorder ieee754 implies so that ldbl-* comes
first.
* sysdeps/m68k/Implies: Likewise.
* sysdeps/sparc/sparc64/Implies: Likewise.
2000-09-16 Jakub Jelinek <jakub@redhat.com>
* elf/readlib.c (process_file): Don't error for stale .so links either.
* elf/dl-load.c (_dl_map_object_from_fd): Add one more
__builtin_expect.