summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/ld
Commit message (Collapse)AuthorAgeFilesLines
* This release is a moderate restructuring of the dynamic linker.jdp1996-01-131-592/+605
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It addresses a number of problems that were present in earlier versions. The calls to the "init" and "fini" functions of shared libraries have been reordered, so that they are called in a strictly nested fashion, as is required for C++ constructors and destructors. In addition, the "init" functions are called in better order relative to each other. That makes the system more tolerant of C++ programs which depend on a library's being initialized before its clients. The dynamic linker is now more tolerant of shared libraries in which dependencies on other shared libraries are incompletely recorded. Cleanup in the event of errors has been improved throughout the dynamic linker. A number of memory leaks were eliminated. The warning message for a shared library whose minor version number is too old has been clarified. The code dealing with the "ld.so.hints" file has been cleaned up. A bug that caused the hints file to be unmapped incompletely has been fixed. A different bug that could potentially cause the hints file to be mapped on top of a loaded object has been fixed. The code that searches for shared libraries has been cleaned up. The searching is now more compatible with that done by SunOS and SVR4. Also, some unnecessary and useless searches of both the hints file and library directories have been eliminated. Reviewed by: nate@freebsd.org
* Split up the code so that a single directory can be searched, tojdp1996-01-132-82/+118
| | | | | | | support some changes in the dynamic linker. (This code is shared by the dynamic linker.) Reviewed by: nate@freebsd.org
* Another '-' needed for make release.phk1996-01-111-2/+2
|
* Make the new realinstall target a little less draconian so that make releasephk1996-01-111-3/+3
| | | | doesn't fall over.
* Install ld.so in a way that is safe even on a running system.jdp1996-01-111-2/+13
|
* recording cvs-1.6 file deathpeter1995-12-301-4/+0
|
* Changed the terminology for what used to be called the "memorizing"nate1995-11-022-188/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vector. Now it is called the "symbol caching" vector. This was made possible and unconfusing by other changes that allowed me to localize everything having to do with the caching vector in the function reloc_map(). Switched to alloca() for allocating the caching vector, and eliminated the special mmap-based allocation routines. Although this was motivated by performance reasons, it led to significant simplification of the code, and made it possible to confine the symbol caching code to the single function reloc_map(). Got rid of the unnecessary and inefficient division loop at the beginning of rtld(). Reduced the number of calls to getenv("LD_LIBRARY_PATH") to just 1, on suggestion from <davidg@root.com>. Added breaks out of the relocation loops when the relocation address is found to be 0. A relocation address of 0 is caused by an unused relocation entry. Unused relocation entries are caused by linking a shared object with the "-Bsymbolic" switch. The runtime linker itself is linked that way, and the last 40% of its relocation entries are unused. Thus, breaking out of the loop on the first such entry is a performance win when ld.so relocates itself. As a side benefit, it permits removing a test from md_relocate_simple() in ../i386/md-static-funcs.c. Unused relocation entries in other shared objects (linked with "-Bsymbolic") caused even bigger problems in previous versions of the runtime linker. The runtime linker interpreted the unused entries as if they were valid. That caused it to perform repeated relocations of the first byte of the shared object. In order to do that, it had to remap the text segment writable. Breaking out of the loop on the first unused relocation entry solves that. Submitted by: John Polstra <jdp@polstra.com>
* Run-time linker speedups - Round Onenate1995-10-251-3/+170
| | | | | | | | | | | | | | | | | | | | Implemented symbol memorizing to reduce the number of calls to lookup(), making relocation go faster. While relocating a given shared object, the dynamic linker maintains a memorizing vector that is directly indexed by the symbol number in the relocation entry. The first time a given symbol is looked up, the memorizing vector is filled in with a pointer to the symbol table entry, and a pointer to the so_map of the shared object in which the symbol was defined. On subsequent uses of the same symbol, that information is retrieved directly from the memorizing vector, without calling lookup() again. A symbol that is referenced in a relocation entry is typically referenced in many relocation entries, so this memorizing reduces the number of calls to lookup() dramatically. The overall improvement in the speed of dynamic linking is also dramatic -- as much as a factor of three for programs that use many shared libaries. Submitted by: jdp@polstra.com "John Polstra"
* Remove LD_NOSTD_PATH implementation, it isn't works andache1995-10-242-6/+4
| | | | | can cause some problems. Suggested-by: davidg
* if uid != euid or gid != egid unsetenv("LD_NOSTD_PATH") tooache1995-10-211-1/+2
|
* This is a FreeBSD manpage, not a NetBSD manpage. :)nate1995-10-051-2/+2
|
* Fix checks for open() failing. open() may successfully return 0.bde1995-09-282-6/+6
| | | | | ld.c: Fix a an error message that said that open() failed after fopen() failed.
* Make the error message more readable when 'ld.so' cannot locate a needednate1995-09-271-13/+11
| | | | | | | | | | | | | | shared library. Formerly, the message looked like this: ld.so: run: libjdp1.so.1.0: Undefined error: 0 The new message looks like this: ld.so: run: Can't find shared library "libjdp1.so.1.0" (Where "run" is the name of the program being executed.) Submitted by: jdp@polstra.com (John Polstra)
* Fixup the "ld.so failed" message for the case when ld.so finds undefinednate1995-09-271-5/+5
| | | | | | | | | | | symbols. An easy example to see this is to develop an X program which links against Xt, but doesn't add -lX11 to the link line. It will link fine, but cause run-time errors by ld.so because of missing symbols used by Xt defined in X11. This patch makes the errors more readable. Submitted by: jdp@polstra.com (John Polstra)
* Stop using gnumalloc.phk1995-09-221-4/+1
|
* Import Paul Kranenburg's man page for ld.so (aka. rtld).joerg1995-08-262-2/+147
| | | | Obtained from: NetBSD
* Reset the umask before creating the output file; otherwise runningjoerg1995-08-161-1/+2
| | | | | ldconfig as root with a restrictive umask yielded ld.so.hints unreadable by the world (and thus useless).
* Make ld's error messages consistent with gcc when no input filesrgrimes1995-07-131-2/+2
| | | | | | are given on the command line. Submitted by: Thomas Graichen <graichen@omega.physik.fu-berlin.de>
* Change ld.so to correctly load dependant libraries for dlopen and unload themdfr1995-06-271-66/+234
| | | | | | | | | | | | | | | | | on dlclose. Also correctly call constructors and destructors for libraries linked with /usr/lib/c++rt0.o. Change interpretation of dlopen manpage to call _init() rather than init() for dlopened objects. Change c++rt0.o to avoid using atexit to call destructors, allowing dlclose to call destructors when an object is unloaded. Change interface between crt0 and ld.so to allow crt0 to call a function on exit to call destructors for shared libraries explicitly. These changes are backwards compatible. Old binaries will work with the new ld.so and new binaries will work with the old ld.so. A version number has been introduced in the crt0-ld.so interface to allow for future changes. Reviewed by: GAWollman, Craig Struble <cstruble@singularity.bevc.blacksburg.va.us>
* Add an "-m" flag to merge instead of replace the entries. We canasami1995-06-242-41/+75
| | | | | | | | | | | now safely add a line like ldconfig -m ${PREFIX}/lib in ports' Makefiles and packing lists without throwing away some directories the user may have added. Submitted by: Mostly by Paul Kranenburg <pk@cs.few.eur.nl>
* Make `ld' properly honoring the umask setting when chmod'ing thejoerg1995-06-141-3/+7
| | | | | | output file for the `x' bits. This is a Posix requirement.
* Remove trailing whitespace.rgrimes1995-05-307-49/+49
|
* Sync. up bits with Paul K. Cascade support plus some cosmetic changes.nate1995-04-211-13/+60
| | | | Obtained from: NetBSD
* Back out my change to enforce command line linker order due tonate1995-04-071-11/+8
| | | | | | | | underlying bugs which are caused by mixing static/shared libraries with this change in place. The shlib code is not capable of supporting this feature in it's present state and will need significant modifications in order to do so.
* Modify the default behavior of the linker to no longer prefer staticnate1995-03-221-9/+12
| | | | | | | | | | | members over shared library members. This modification causes the linker to use the first definition it sees for a symbol instead of having priorities based on the library type. This modification should allow gdb to compile again. Obtained from: Email conversation with Paul Kranenbury, but implemented completely by me. If it doesn't work, it's my fault not his.
* Removed /usr/local/lib from the standard library search path to benate1995-03-191-2/+2
| | | | | | | consistant. Programs shouldn't rely on non-standard paths for bringing in default libraries. Suggested by: Andreas Schulz <ats@freebsd.first.gmd.de>
* Back out Poul's hack that forces static libgcc. This has been fixed viadg1995-03-101-11/+2
| | | | gcc instead.
* Never again shall we link libgcc dynamic. It was a big mistake in thephk1995-03-061-2/+11
| | | | | | | | first place and we were too long in finding out. Now we know, and the damage is hard to fix. This is part one: ld will not link gcc dynamic, if specified as "-lgcc". Suggested by: dyson & davidg
* Weak symbol support from NetBSD. This should bring us in sync with thenate1995-03-0414-555/+706
| | | | | | | | NetBSD ld code except for local changes for dlopen() and friends and the hashing on the minor value of the shlibs. We should be binary compatible now with all their libraries. Obtained from: NetBSD
* Support for more Sun compatible dlopen() and friends. Also added proper errorjkh1995-02-071-87/+205
| | | | | | handling. Reviewed by: gj Submitted by: Mark Diekhans <markd@grizzly.com>
* Make ldconfig and ld.so not hashing the shared lib minor number. Thisjoerg1995-01-122-12/+10
| | | | | | | | | | misfeature caused troubles when a program attempted to access a shlib where one with a higher minor number has been hashed. Ldconfig does only include the highest-numbered shlib anyway, so this is in no way a limitation of generality. Caution: after installing the new programs, your /var/run/ld.so.hints needs to be rebuiult; run ldconfig again as it's done from /etc/rc.
* Change toswallace1995-01-051-2/+2
| | | | | #define STANDARD_SEARCH_DIRS "/usr/lib", "/usr/X11R6/lib", "/usr/local/lib" Like in 2.0R, except without /usr/X386.
* New file from pk to aid new in developing the shlib code for newnate1994-12-231-0/+192
| | | | | | architectures. Obtained from: NetBSD
* Updated to recent version of Paul K.'s shlib code. This code has betternate1994-12-2318-411/+579
| | | | | | | | | | warning handling and allows for link-time warnings with a modified version of gas. Note: Not all of the newer bits were updated such as some of the non-x86 machine-dependant code is relevant to FreeBSD right now. Obtained from: NetBSD
* Changed one occurrence of LD 8 to LD 1 and the OS FreeBSD 1.1 to FreeBSD 2.0.ats1994-12-112-6/+6
|
* Add LDDESTDIR to ld command.swallace1994-09-181-2/+6
| | | | Add -I${DESTDIR}/usr/include to cpp command.
* Unmap hints file when finished with it, so that it can go awaybde1994-09-151-1/+21
| | | | | | | completely when ldconfig unlinks it. If init is shared, then the referenced unlinked copy of the hints file created by running ldconfig in /etc/rc caused the file system to be unclean after every reboot.
* Add dependencies on libraries to DPADD. Someday this should be donebde1994-08-281-2/+3
| | | | | | automagically. -lfoo has to be right to work, but ${LIBFO0} is too easy to forget or misspell; nothing checks it and it should be different for shared libraries.
* Install ld.so immutable.wollman1994-08-261-1/+2
|
* Don't explicitly define __FreeBSD__ - this is no longer necessary.dg1994-08-191-2/+2
|
* Remove reference to the ld.so man page - ain't no such animal.jkh1994-06-171-1/+0
| | | | Reported by John Lind.
* Changes from Paul Kranenburg which bring us into sync with his sources:rich1994-06-1519-891/+933
| | | | | | | | | | | | | | handling of errors through the standard err() and warn() more fixes for Geoff Rehmet's NULL pointer bug. fixes NULL pointer bugs when linking mono and nested X servers. supports a `-nostdlib' option. accept object files without a symbol table don't attempt dynamic linking when `-A' is given a few variable names have chaged (desc -> fd), and the formatting has changed which should make it much easier to track his sources. I tested 'make world' for /usr/src and X twice with these changes.
* Bug reported by Jon-Dean Mountjoy <csjm@cs.ru.ac.za>csgr1994-06-141-1/+10
| | | | | | | | | | | | | Paul Kranenburg's description: ld is in error here, assuming that symbols with N_EXT set always have an entry in the (global) symbol table: this is not the case for C++ generated constructor/destructor symbols. I can reproduce your failure by fudging a "multiply defined" constructor symbol by hand. Checking for `g == NULL' seems to be a ok as a fence for now. So: for now, in do_file_warnings() we check if g == NULL, before trying to generate any warning messages. This prevents a NULL pointer dereference.
* Add the -r and -s flags to the Usage string.ats1994-06-051-2/+2
|
* Change the private declarations from dlopen,dlclose,dlsym,dlctlats1994-04-131-10/+10
| | | | | | to public. These functions are also used in /usr/include/link.h, so it looks, like they shouldn't be private. I will ask Paul about that, if this is correct.
* Better link ldconfig static instead dynamic.ats1994-04-131-2/+2
|
* Add that /usr/X386/lib is also in the default path for ldconfig. Bug foundats1994-04-051-1/+3
| | | | | by Satoshi Asami ( asami@cs.berkeley.edu ). Fixed also a minor typo problem.
* Due to the deletion of the gcc support from libc we need again theats1994-03-101-2/+2
| | | | | -lgcc_pic library. rtld uses the udivd3 routine from it. Repeat the bug by simply compiling ld on current.
* Document existance of -Zdg1994-03-092-2/+6
|
* Handling of the netzmagic flag was completely missing after the lastdg1994-02-171-2/+7
| | | | update. This completely broke support for all ZMAGIC a.out formats.
OpenPOWER on IntegriCloud