From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MjDuJ-000535-Tr for qemu-devel@nongnu.org; Thu, 03 Sep 2009 11:07:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MjDuF-0004xq-44 for qemu-devel@nongnu.org; Thu, 03 Sep 2009 11:07:27 -0400 Received: from [199.232.76.173] (port=36462 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MjDuE-0004xZ-St for qemu-devel@nongnu.org; Thu, 03 Sep 2009 11:07:22 -0400 Received: from an-out-0708.google.com ([209.85.132.250]:25633) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MjDuE-0005iG-HU for qemu-devel@nongnu.org; Thu, 03 Sep 2009 11:07:22 -0400 Received: by an-out-0708.google.com with SMTP id c38so698223ana.37 for ; Thu, 03 Sep 2009 08:07:21 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <200909031538.19806.paul@codesourcery.com> References: <87ljkxibay.fsf@lechat.rtp-net.org> <20090903120010.GA27116@1und1.de> <200909031538.19806.paul@codesourcery.com> Date: Thu, 3 Sep 2009 18:07:21 +0300 Message-ID: Subject: Re: [Qemu-devel] [PATCH v2] Build *-user targets as PIE From: "Kirill A. Shutemov" Content-Type: text/plain; charset=UTF-8 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: qemu-devel@nongnu.org On Thu, Sep 3, 2009 at 5:38 PM, Paul Brook wrote: >> PIE code usually is a bit slower. Approximately, 1% for i386 according to >> some tests. RISC architectures should be affected less, since they have >> more registers. On other hand we are getting rid from text relocations on >> i386 which make executable loading slower. So... > > I think you've got that backwards. > A traditional (fixed address) executable requires no load-time relocation for > internal references because all addresses are known at static link time. PIE > require the dynamic linker adjust all absolute addresses. Usermode qemu on i386 is not a traditional executable, sicne it uses -Wl,-shared for linking. In result we've got an executable which looks like PIE, but dynamic linker have to resolve text relocations. I think the best way it to create a true PIE without a text relocations. P.S. I press "reply" instead "reply all" first time.