From owner-cvs-gnu Wed Oct 25 09:16:54 1995 Return-Path: owner-cvs-gnu Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id JAA23487 for cvs-gnu-outgoing; Wed, 25 Oct 1995 09:16:54 -0700 Received: (from nate@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id JAA23460 ; Wed, 25 Oct 1995 09:16:41 -0700 Date: Wed, 25 Oct 1995 09:16:41 -0700 From: Nate Williams Message-Id: <199510251616.JAA23460@freefall.freebsd.org> To: CVS-commiters, cvs-gnu Subject: cvs commit: src/gnu/usr.bin/ld/rtld rtld.c Sender: owner-cvs-gnu@FreeBSD.org Precedence: bulk nate 95/10/25 09:16:39 Modified: gnu/usr.bin/ld/rtld rtld.c Log: Run-time linker speedups - Round One 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"