This package contains my shared, dynamic linker (ld.so) and utilities
(ldconfig and ldd) for Linux.

For those that were not involved in the development of ld.so, its main
feature is that the user-level, shared library and dynamic linking
support has been moved to its own, special shared library.  This has
two significant advantages.  First, the startup code for all binaries,
which must be linked statically, is reduced by about 2.5k.  Second,
and probably more important, the shared library and dynamic linking
support can be upgraded for all binaries without having to relink by
simply installing a new ld.so.

In addition to ld.so, this package also includes two, related
utilities, ldconfig and ldd.  Ldconfig is used to automatically update
symbolic links to shared libraries and build the library cache used by
ld.so.  This should hopefully put an end to the common problem of
accidentally deleting a critical library link (eg. /lib/libc.so.4).
Ldd is used to list the shared libraries dependencies for a binary.

In order to use the debugging, library version of ld.so, the program
must be explcitly linked with the static libc.a.

Please see the included manual pages for further details.

To install, simply run "sh instldso.sh" as root.  Ready-to-go versions
of all end-products are provided so nothing should need to be compiled
or linked.

By default, both a.out and ELF versions of gcc, binutils and libc are
currently needed to recompile everything.  If the ELF versions are
installed as the default, set the value of GCC_DEFAULT to 'elf' in
Config.mk, otherwise, set it to aout.  Also, if you have an a.out-only
system, set the value of ELF_SUPPORT to false and if you have an
ELF-only system, set the value of AOUT_SUPPORT to false.  Furthermore,
optimization level O2 or higher must be used to recompile ld-linux.so
due the use of inline functions.

Notable contributors to this package include Eric Youngdale, Peter
MacDonald, Hongjiu Lu, Linus Torvalds, Lars Wirzenius, Mitch D'Souza,
Rik Faith, Andreas Schwab and Adam Richter (not necessarily in that
order).

Changes in version 1.7.14:

	Changed ldconfig to recognize ELF shared libraries
	generated by post-2.6 versions of ld (Andreas Schwab).

	Changed ldconfig to not remove stale links that do not
	have a version number since they may be needed by ld.

Changes in version 1.7.13:

	Fixed a problem in ld-linux.so where a program linked
	with a shared library that was not used could result in
	a segmentation fault (H.J. Lu).

Changes in version 1.7.12:

	Fixed a problem in libdl.so where the wrong library
	could be marked as global when RTLD_GLOBAL was used
	(Lars Heete).

	Installed dlfcn.h with libdl.so instead of requiring
	it to be supplied with libc.

	Removed support for libldso.a since it was nearly
	impossible to use anyway.

	Changed ldd to detect when the program being checked
	exited abnormally.

Changes in version 1.7.11:

	Changed ld.so and ld-linux.so to delete all variations
	of LD_PRELOAD and LD_LIBRARY_PATH for set[ug]id programs,
	This makes it harder for broken set[ug]id programs to be
	compromised.

	Fixed a problem in libdl.so where dlsym would not accept
	the handle returned from dlopen(0, *).

Changes in version 1.7.10:

	Changed ld-linux.so and libdl.so to support RTLD_GLOBAL
	(Eric Youngdale).

Changes in version 1.7.9:

	Fixed a problem in ld-linux.so in detecting when the 
	new user/group information is provided by the kernel.

	Fixed a problem in ld-linux.so where a buffer could be
	overflowed if a large number of libraries were loaded
	(Thomas Moore).

Changes in version 1.7.8:

	Changed the Makefiles and install scripts to support 
	a.out- and ELF-only configurations.

	Changed ld-linux.so to use the user/group information
	provided by linux 1.3.23+ instead of making syscalls
	to get it.

	Changed libdl.so to support RTLD_NEXT (Glenn Fowler).

	Changed libdl.so to only execute the fini sections
	instead of completely closing libraries at exit (Glenn
	Fowler).

	Changed ld.so and ld-linux.so to print the required
	cache version when a mismatch is detected.

	Changed ld-linux.so to not require on /dev/zero (Ralph
	Loader).

	Minor m68k cleanups (Andreas Schwab).

Changes in version 1.7.7:

	Fixed problems compiling with recent 1.3.x kernels.

	Changed ld-linux.so to not use MAP_DENYWRITE until the
	permission issue regarding it is resolved.

Changes in version 1.7.6:

	Fixed a bug in ld-linux.so dealing with a zero-length
	LD_{ELF_}PRELOAD.

	Changed ld.so and ld-linux.so to truncate all variations
	of LD_PRELOAD and LD_LIBRARY_PATH for set[ug]id programs.

Changes in version 1.7.5:

	Changed ldconfig to recognize libraries without any
	version number (eg. libXYZ.so).

	Changed ldconfig to not generate a corrupt cache when
	the disk is full or other write errors occur.

	Changed ld-linux.so to map files with MAP_DENYWRITE to
	keep them from being changed while the file is in use
	(Rick Sladkey).

	Changed libdl to not overwrite the scope pointer of a 
	library if it was already loaded (H.J. Lu).

	Changed ld-linux.so so gdb can be used on constructors
	(Eric Youngdale).

	Changed ldconfig to ignore ELF libraries where the soname
	does not match the file name on the assumption that it is
	a used at compile-time (eg. libcurses.so -> libncruses.so).

Changes in version 1.7.4:

	Changed ld-linux.so and libdl to use the appropriate
	rpaths when searching for shared libraries (Eric
	Youngdale).

	Changed ld-linux.so to search rpath before using the
	cache.  This more closely conforms to the IBCS standard.

Changes in version 1.7.3:

	Changed ld-linux.so to only print a library name the
	first time it is loaded when run from ldd.

	Fixed a bug in ldconfig where an invalid cache could be
	generated if a directory was specified multiple times in
	ld.so.conf.

	Changed ld-linux.so so it will return the address of a
	weak symbol when called from dlsym in libdl (Eric 
	Youngdale.

Changes in version 1.7.2:

	Changed libdl.so again to fix the undefined foobar
	problem.

Changes in version 1.7.1:

	Changed libdl so it will compile at optimization level
	O3 or higher.

	Changed ldconfig to always create the cache file with 
	mode 644.

	Changed ldconfig to not ingore valid symlinks.

	Changed ldconfig to use the library name as the soname 
	for ELF libraries that do not have an soname entry.

	Changed ld-linux.so to print the actual, requested library
	name at the time it is loaded instead of trying to figure
	it out after the fact.

Changes in version 1.7.0:

	Changed ldconfig to read the actual soname from the image
	for ELF libraries and make it available to ld-linux.so.  
	The soname for DLL libraries is still determined by
	truncating the minor numbers from the image file name.

	Changed ldconfig to no longer support the undocumented
	sort options.

	Changed ld.so to require a valid cache to find libraries
	in directories specified in ld.so.conf.  /usr/lib and /lib
	are still searched as a last resort.  Ld-linux.so already
	operated this way.

	Fixed a bug in libldso.a where the arguments to
	shared_loader were not parsed correctly (Wolfram Gloger).

	Added support for RELA-style relocations under Linux/68k
	(Andreas Schwab).

	Changed ld-linux.so to only map the cache once for all
	libraries instead of individually for each library.

	Changed ld-linux.so continue searching the cache instead of
	giving up when failing to load the first entry found.

	Changed ld-linux.so to produce output similar to ld.so when
	run from ldd or when errors occur.

Changes in version 1.6.7:

	Changed the install scripts to make sure that ld.so and
	ld-linux.so are always usable.

	Added support for Linux/Sparc (Eric Youngdale).

	Added support for Linux/68k (Andreas Schwab).

	Fixed various bugs in ld-linux.so dealing with closing
	files, unmapping memory, dereferencing NULL pointers and 
	printing library names (David Engel, Eric Youngdale and 
	Andreas Schwab).

	Replaced the manual page for libdl with a freely
	distributable one (Adam Richter).

	Fixed a bug in ld-linux.so where LD_LIBRARY_PATH and
	LD_PRELOAD were not cleared for setuid/setgid programs.

	Fixed a bug in libdl where dlsym would not return the
	correct address of a symbol if it was redefined in another
	library (Oleg Kibirev).

	Changed ld-linux.so to use the following order to search 
	for libraries:  LD_{ELF_}LIBRARY_PATH, ld.so.cache, rpath, 
	/usr/lib and /lib.

	Changed ld-linux.so to not needlessly allocate memory when
	using ld.so.cache.

Changes in version 1.6.6:

	Changed ldconfig to not warn about removing stale links
	unless the -v option is specified.

	Added manual pages for libdl (from FreeBSD/Sun)

	Fixed a bug in ld.so dealing with preloading of objects
	generated by recent versions of ld (Mitch D'Souza).

	Fixed bugs in ldd where some errors were either not
	detected or not printed.

	Fixed a bug in ld-linux.so where the trailing nul in a
	library name was not being copied (Owen Taylor).

Changes in version 1.6.5:

	Changed ldconfig to remove stale symbolic links.

	Added debug hooks in ld-linux.so and libdl.so to be used 
	by a future version of gdb (Eric Youngdale).

Changes in version 1.6.4:

	Change ld-linux.so to print on stdout instead of stderr
	when run from ldd.

	Added support for Debian GNU/Linux packaging.

Changes in version 1.6.3:

	Fixed a bug in libdl when closing a library (H.J. Lu).

Changes in version 1.6.2:

	Changed the error message printed by ldd when a file is
	not a.out or ELF.  It used to only list a.out formats.

	Changed ldconfig to no longer cache and set up links for
	ld-linux.so.

	Changed ld-linux.so and libdl to not conflict with upcoming
	changes in kernel header files.

	Changed ld-linux.so to not print preloaded libraries.

Changes in version 1.6.1:

	Updated the installation script.

	Changed ld.so and ld-linux.so to look for LD_AOUT_PRELOAD
	and LD_ELF_PRELOAD, respectively, before LD_PRELOAD.

	Changed ld.so and ld-linux.so to use LD_AOUT_LIBRARY_PATH
	and LD_ELF_LIBRARY_PATH, respectively, instead of
	AOUT_LD_LIBRARY_PATH and ELF_LD_LIBRARY_PATH.

Changes in version 1.6.0:

	Changed ldconfig to process libraries which do not have
	a minor version or patch level number.

	Incorporated ld-linux.so and libdl.so.

	Changed ld.so and ld-linux.so to not miss entries in the
	cache when the fully qualified library is requested.

	Changed ldconfig to use stdout instead of stderr when
	printing the cache.

Changes in version 1.5.3:

	LD_PRELOAD enhancements (Tristan Gigold).

	LD_PRELOAD patch for linux-68k (Andreas Schwab).

Changes in version 1.5.2:

	More ELF changes (Mitch D'Souza).

	Changed ldconfig to also update the link for ld-linux.so.

Changes in version 1.5.1:

	More ELF and LD_PRELOAD changes (Mitch D'Souza).

Changes in version 1.5.0:

	Chnaged all executables to QMAGIC (Mitch D'Souza and Rick
	Sladkey).

	Added preliminary support for ELF to ldd and ldconfig (Eric 
	Youndale and H.J. Lu).

	Added support for LD_PRELOAD to ld.so (Mitch D'Souza).

	Removed the "advertising" clause from the copyright notices
	in all source files.

Changes in version 1.4.4:

	Changed ldconfig to support QMAGIC libraries.

	Fixed a bug in ld.so where some of the error messages had
	transposed arguments.

Changes in version 1.4.3:

	Fixed an obscure bug in ld.so where an index was not being
	incremented when a library was not found using the cache.

Changes in version 1.4.2:

	Changed ldconfig to issue a warning and continue instead
	of an error and exiting when a link can't be updated.  
	This is useful when some libraries are imported on read-
	only file systems, such as an NFS mounted /usr.

	Changed ld.so to be more robust in searching for libraries.
	A library is not considered found unless it can actually be
	loaded.  If a library is not found using the cache, the
	standard directories are searched as in pre-cache versions.

Changes in version 1.4.1:

	Fixed minor Makefile problems.

	Added support for linux-68k.

	Fixed a bug in ld.so where libraries with absolute paths
	were not handled correctly.

	Changed ld.so to ignore the directory in the names of
	shared libraries by default.  This allows older libraries
	with absolute paths, such as the XView libraries, to take
	advantage of the cache support.

	Added a minimal usage message to ldconfig.

Changes in version 1.4:

	Fixed bug in ld.so where minor version numbers were not
	reported correctly when a minor version incompatibility
	was found.

	Fixed bug in ldconfig where libraries with subversion
	numbers greater than 9 were not compared correctly.

	Added Mitch D'Souza's support for suppressing warning
	messages from ld.so about minor version incompatibilities.

	Added Mitch D'Souza's support for using a cache to speed
	up searching for libraries in the standard directories.

	Added Mitch D'Souza's support for a debugging version of
	ld.so.  Link with -lldso if you think you are experiencing
	dynamic linker problems.

Changes in version 1.3:

	Added support for libraries using absolute pathnames.  If I
	had known that the XView libraries used them, I would have
	added this earlier.

	Fixed a bug handling old libraries using a pathname beginning
	with '/' or '/lib/'.

Changes in version 1.2a:

	Fixed a minor bug in ldd which caused all files, specifically
	scripts, to be recognized as binaries.  Thanks to Olaf Flebbe
	for reporting it.

David Engel
david@ods.com
