From owner-freebsd-hackers@FreeBSD.ORG Tue Feb 26 21:04:29 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 81CAE79; Tue, 26 Feb 2013 21:04:29 +0000 (UTC) (envelope-from damjan.jov@gmail.com) Received: from mail-la0-x22b.google.com (mail-la0-x22b.google.com [IPv6:2a00:1450:4010:c03::22b]) by mx1.freebsd.org (Postfix) with ESMTP id B46E11FED; Tue, 26 Feb 2013 21:04:28 +0000 (UTC) Received: by mail-la0-f43.google.com with SMTP id ek20so4412639lab.30 for ; Tue, 26 Feb 2013 13:04:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=S1fp+DhwxGD3yGlw5/SqvdzS7+Np6kgwtMH1VixTGWY=; b=Ei8eSb9GUoRBqYo90dyt6qVaIyUiFFdca4LQlsJ889oSYu/bZWPX4sFVfzMSM5wE3p ohHA2Cale/nEzWt1FsRE1wpyicEbsWKIrJdIgQmjjivwIr8IQ8uBpO7AL9RvF9AENQ0H t2rHuEOZh70nBnduIlDUim4IlMiIWLJMhwMqQwYQziGcmow+aXqvL8zkUsvH+YM2YOuE 3/jn6XcA21ht6PvciOJ1WWLyyyTCmRW68iiEKFSz94/pkcYrn9JUA47AlbR7vaUK532n i48sNyCNd3HBg1A6BNzt3+WQPv7kExuY6EGJovxbPOeWX28HJXAplKArZzRGcDRTpwQK qShQ== X-Received: by 10.112.37.194 with SMTP id a2mr1162947lbk.40.1361912667364; Tue, 26 Feb 2013 13:04:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.152.20.138 with HTTP; Tue, 26 Feb 2013 13:04:07 -0800 (PST) In-Reply-To: <20130221213528.GD92116@felucia.tataz.chchile.org> References: <20130221213528.GD92116@felucia.tataz.chchile.org> From: Damjan Jovanovic Date: Tue, 26 Feb 2013 23:04:07 +0200 Message-ID: Subject: Re: [patch] Wine DLL base address patches To: Damjan Jovanovic , freebsd-emulation@freebsd.org, freebsd-hackers@freebsd.org, tijl@coosemans.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2013 21:04:29 -0000 On Thu, Feb 21, 2013 at 11:35 PM, Jeremie Le Hen wrote: > Hi Damjan, > > On Wed, Feb 20, 2013 at 05:29:01PM +0200, Damjan Jovanovic wrote: >> >> Wine needs some of its libraries to be loaded at specific base >> addresses (https://wiki.freebsd.org/Wine), something FreeBSD currently >> lacks. >> >> I've written a patch to the dynamic loader (/libexec/ld-elf.so.1) that >> loads libraries at their preferred base addresses >> (http://www.freebsd.org/cgi/query-pr.cgi?pr=176216), as well as a port >> of Prelink to FreeBSD which Wine uses to set base addresses >> (http://www.freebsd.org/cgi/query-pr.cgi?pr=176283). Both work :-), >> the changed dynamic loader doesn't show any problems in a few days of >> testing, and prelink works with the --reloc-only option as used by >> Wine. > > Thanks for this work. > > Out of curiosity, did you try to run prelink on the whole base system? > If yes, did you make any measurement of the performance improvement? > > Thank you! > -- > Jeremie Le Hen > > Scientists say the world is made up of Protons, Neutrons and Electrons. > They forgot to mention Morons. I didn't, please let us know if you do. IMO it would be a lot better to add -Bdirect support like Solaris has (http://sourceware.org/ml/binutils/2005-10/msg00436.html), both for better performance and because it works around ELF's moronic idea of resolving symbols by searching for them in all libraries in the order they were loaded, which easily causes memory corruption and crashes if eg. 2 versions of a library are loaded into the same process.