summaryrefslogtreecommitdiffstats
path: root/libexec/rtld-aout/i386
diff options
context:
space:
mode:
authornate <nate@FreeBSD.org>1995-11-02 18:48:15 +0000
committernate <nate@FreeBSD.org>1995-11-02 18:48:15 +0000
commited6a6a65670079c8b2d3d4008ac425217ff14e95 (patch)
tree268e88c2d5d31e305b8988de9cdd8493e0808d70 /libexec/rtld-aout/i386
parent0edd99baa0eb9b719bb5deca0eac23eb01a3cb9f (diff)
downloadFreeBSD-src-ed6a6a65670079c8b2d3d4008ac425217ff14e95.zip
FreeBSD-src-ed6a6a65670079c8b2d3d4008ac425217ff14e95.tar.gz
Changed the terminology for what used to be called the "memorizing"
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>
Diffstat (limited to 'libexec/rtld-aout/i386')
-rw-r--r--libexec/rtld-aout/i386/md-static-funcs.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libexec/rtld-aout/i386/md-static-funcs.c b/libexec/rtld-aout/i386/md-static-funcs.c
index 4741685..64491e3 100644
--- a/libexec/rtld-aout/i386/md-static-funcs.c
+++ b/libexec/rtld-aout/i386/md-static-funcs.c
@@ -1,17 +1,16 @@
/*
- * $Id: md-static-funcs.c,v 1.2 1993/12/08 10:14:44 pk Exp $
+ * $Id: md-static-funcs.c,v 1.2 1994/02/13 20:42:06 jkh Exp $
*
* Called by ld.so when onanating.
* This *must* be a static function, so it is not called through a jmpslot.
*/
-static void
+static inline void
md_relocate_simple(r, relocation, addr)
struct relocation_info *r;
long relocation;
char *addr;
{
-if (r->r_relative)
*(long *)addr += relocation;
}
OpenPOWER on IntegriCloud