From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uer5I-0002At-0l for qemu-devel@nongnu.org; Tue, 21 May 2013 14:14:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uer5F-00046B-HC for qemu-devel@nongnu.org; Tue, 21 May 2013 14:14:51 -0400 Received: from mail-gh0-f169.google.com ([209.85.160.169]:64117) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uer5F-000465-DD for qemu-devel@nongnu.org; Tue, 21 May 2013 14:14:49 -0400 Received: by mail-gh0-f169.google.com with SMTP id r1so289082ghr.0 for ; Tue, 21 May 2013 11:14:48 -0700 (PDT) Sender: Richard Henderson Message-ID: <519BB993.7070703@twiddle.net> Date: Tue, 21 May 2013 11:14:43 -0700 From: Richard Henderson MIME-Version: 1.0 References: <519A5B9F.6090507@twiddle.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Could configure generate QEMU's linker scripts? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ed Maste Cc: Michael Tokarev , qemu-devel@nongnu.org On 05/21/2013 10:51 AM, Ed Maste wrote: > On 20 May 2013 13:21, Richard Henderson wrote: >> In general I believe that using the -Ttext-segment ADDR flag for ld >> would completely obviate the need for even editing the link script. > > That sounds cleaner, although there's a wrinkle for FreeBSD. We're > still using binutils version 2.17.50 in the base system, since it is > the last one licensed under GPLv2, and it doesn't support the > -Ttext-segment flag. There is -Ttext but it still leaves some parts > behind at the default load address. I assume that the reason for > changing the QEMU load address is to leave the default free for the > guest application to use, making -Ttext unsuitable. > > If we can't use an approach along the lines of my earlier sed script > we'll just have to find a way to support -Ttext-segment in FreeBSD, > either by having the original patch that introduced it made available > under GPLv2, reimplementing the functionality, or by requiring use of > a later binutils (from the FreeBSD ports tree). Certainly using a decent binutils would be easiest. Although for the purposes of getting the qemu application out of the virtual address space that the *-bsd-user guest will want to use, it might be better to use -fPIE. At least on linux that tends to put the x86_64 host binary up in (very) high memory. The best long term solution is to be able to enable softmmu for *-user guests. It's the only way to make certain 64-on-32 combinations work, and the only way to fix a myriad of problems that occur when the host and guest page sizes don't match. At which point it doesn't matter where the host binary resides. > One oddity I noticed is that alpha and s390x seem to not use the ld > script (with the comment "The default placement of the application is > fine" in configure), so I'm not sure why QEMU includes those files. I thought I deleted those when I changed the configure script... r~