From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MjDfc-0005tQ-CY for qemu-devel@nongnu.org; Thu, 03 Sep 2009 10:52:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MjDfW-0005qZ-Ij for qemu-devel@nongnu.org; Thu, 03 Sep 2009 10:52:16 -0400 Received: from [199.232.76.173] (port=33119 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MjDfW-0005qN-6F for qemu-devel@nongnu.org; Thu, 03 Sep 2009 10:52:10 -0400 Received: from fg-out-1718.google.com ([72.14.220.159]:62354) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MjDfV-0002i0-JB for qemu-devel@nongnu.org; Thu, 03 Sep 2009 10:52:09 -0400 Received: by fg-out-1718.google.com with SMTP id e21so1404202fga.10 for ; Thu, 03 Sep 2009 07:52:08 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4A9FD812.9010501@gnu.org> Date: Thu, 03 Sep 2009 16:52:02 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <87ljkxibay.fsf@lechat.rtp-net.org> <20090903120010.GA27116@1und1.de> <200909031538.19806.paul@codesourcery.com> In-Reply-To: <200909031538.19806.paul@codesourcery.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH v2] Build *-user targets as PIE List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: "Kirill A. Shutemov" , qemu-devel@nongnu.org On 09/03/2009 04: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. Yes, but since it's also compiled as PIE, there are no absolute addresses. Previously QEMU was linked -shared but compiled as non-position independent code. I am not sure whether only the self-virtualized machine would be subject to relocation, or also the outer one (maybe address space virtualization would also have to be taken into account?). Anyway, as far as text relocations are concerned Kirill's pathc cannot make things worse. Paolo