From owner-freebsd-current@FreeBSD.ORG Sun May 25 03:32:39 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A4E1E37B408 for ; Sun, 25 May 2003 03:32:39 -0700 (PDT) Received: from sasami.jurai.net (sasami.jurai.net [66.92.160.223]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0FD2F43FAF for ; Sun, 25 May 2003 03:32:39 -0700 (PDT) (envelope-from mdodd@FreeBSD.ORG) Received: from sasami.jurai.net (sasami.jurai.net [66.92.160.223]) by sasami.jurai.net (8.12.9/8.12.9) with ESMTP id h4PAWc3q081263; Sun, 25 May 2003 06:32:38 -0400 (EDT) (envelope-from mdodd@FreeBSD.ORG) Date: Sun, 25 May 2003 06:32:38 -0400 (EDT) From: "Matthew N. Dodd" X-X-Sender: winter@sasami.jurai.net To: current@FreeBSD.ORG Message-ID: <20030525061524.H30007@sasami.jurai.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Bang Jun-Young Subject: Preliminary ELF prebinding patches available. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2003 10:32:40 -0000 I've implemented per-executable ELF prebinding: ftp://ftp.jurai.net/users/winter/patches/prebind.patch Initial performance measurements are very encouraging. I originally ported the work that Bang Jun-Young (junyoung@netbsd.org) did for NetBSD (RelCache. See ftp://ftp.netbsd.org/pub/NetBSD/misc/junyoung) but found that there were too many problems to work around and that the cache file size made it impractical. This patch requires toolchain changes (included) to allow the linker to add a 'BUILDID' section to each library and executable. This section allows the prebinding file to be validated. There are only two assumptions this implementation makes: 1. The number of libraries does not change. 2. The order of libraries does not change. (This means that the prebinding file will be invalidated if LD_PRELOAD is used or if a new dependency is introduced via a shared library etc.) Solving these will require further kernel support (similar to OS X in some respects). There are a few more changes I need to make, and documentation to write, as well some testing and performance measurements. I should also note that these changes are x86 only at this point. Comments welcome. -- | Matthew N. Dodd | '78 Datsun 280Z | '75 Volvo 164E | FreeBSD/NetBSD | | winter@jurai.net | 2 x '84 Volvo 245DL | ix86,sparc,pmax | | http://www.jurai.net/~winter | For Great Justice! | ISO8802.5 4ever |