On 05/21/2013 10:51 AM, Ed Maste wrote: > On 20 May 2013 13:21, Richard Henderson <r...@twiddle.net> 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~