From owner-freebsd-current@FreeBSD.ORG Tue Nov 18 21:11:22 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 A900316A4CE; Tue, 18 Nov 2003 21:11:22 -0800 (PST) Received: from VARK.homeunix.com (adsl-68-123-40-77.dsl.pltn13.pacbell.net [68.123.40.77]) by mx1.FreeBSD.org (Postfix) with ESMTP id 937A143FE0; Tue, 18 Nov 2003 21:11:21 -0800 (PST) (envelope-from das@FreeBSD.ORG) Received: from VARK.homeunix.com (localhost [127.0.0.1]) by VARK.homeunix.com (8.12.9/8.12.9) with ESMTP id hAJ59Uen063809; Tue, 18 Nov 2003 21:09:30 -0800 (PST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.homeunix.com (8.12.9/8.12.9/Submit) id hAJ59UvL063808; Tue, 18 Nov 2003 21:09:30 -0800 (PST) (envelope-from das@FreeBSD.ORG) Date: Tue, 18 Nov 2003 21:09:30 -0800 From: David Schultz To: Robert Watson Message-ID: <20031119050930.GA63754@VARK.homeunix.com> Mail-Followup-To: Robert Watson , dyson@iquest.net, current@FreeBSD.ORG, "M. Warner Losh" References: <20031119040135.GA63031@VARK.homeunix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: cc: dyson@iquest.net cc: current@FreeBSD.ORG cc: "M. Warner Losh" Subject: Re: Unfortunate dynamic linking for everything 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: Wed, 19 Nov 2003 05:11:22 -0000 On Tue, Nov 18, 2003, Robert Watson wrote: > On systems like Mac OS X, use of a "shared > region" permits not only use of prebinding, but assumptions of common load > addresses for common libraries. In addition, the "shared region" approach > allows the reuse of page table and VM meta-data across many processes. > Leaving aside special-purpose optimizations like that, using some simple > heuristics, we could probably easily reduce the number of load addressed > dramatically, making prebinding a far more feasible approach, and > something we should explore thoroughly. IIRC, Dyson proposed something like that a while ago. It's a neat idea, particularly if it gets us away from PIC on register-starved architectures such as the i386. > John Dyson's suggestion of "mixed mode" linking, in which we statically > link known required parts of binaries, but permit dynamic linking of > "plug-in" functionality is another quite reasonable solution, as long as > we take care of the potential issue of "plug-ins" relying on symbols from > a library that is statically linked to the application, but not in the set > of symbols depended on by the application. Wouldn't the first shared object you loaded instantly pull in libc.so as a dependency, giving you pieces of both a static and a dynamic libc? It seems that that would break something... > For big applications like KDE, Open Office, et al, prebinding probably is > the right approach, and hopefully we have plenty of time before 5.3 to > refine Matthew's work and see if we can't get things up to speed. For these applications, the fork/exec overhead is so far into the noise and there are so many shared libraries that dynamic linking wins outright, prebinding or not. Maybe for servers that fork a lot this would be more contentious.