From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52663) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpOhN-00069B-Jo for qemu-devel@nongnu.org; Wed, 19 Jun 2013 16:09:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UpOhL-0002WB-Bu for qemu-devel@nongnu.org; Wed, 19 Jun 2013 16:09:45 -0400 Received: from mail-vc0-f181.google.com ([209.85.220.181]:59045) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpOhL-0002W6-7w for qemu-devel@nongnu.org; Wed, 19 Jun 2013 16:09:43 -0400 Received: by mail-vc0-f181.google.com with SMTP id lf11so4103434vcb.40 for ; Wed, 19 Jun 2013 13:09:42 -0700 (PDT) Sender: Richard Henderson Message-ID: <51C21001.60601@twiddle.net> Date: Wed, 19 Jun 2013 13:09:37 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1371608954-86331-1-git-send-email-emaste@freebsd.org> <51C1F77C.2010109@twiddle.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFT PATCH] configure: Simplify alternate .text segment List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ed Maste Cc: qemu-devel On 06/19/2013 12:57 PM, Ed Maste wrote: > Sounds good, although we need to pick up __executable_start too I > think; from my ld --verbose: > # PROVIDE (__executable_start = 0x400000); . = 0x400000 + SIZEOF_HEADERS; > > How about this? > > $ld --verbose | sed \ > -e '1,/==================================================/d' \ > -e '/==================================================/,$d' \ > -e "s/[.] = .* [+] SIZEOF_HEADERS/. = $textseg_addr + SIZEOF_HEADERS/" \ > -e "s/__executable_start = [0-9x]*/__executable_start = > $textseg_addr/" > config-host.ld Looks good. Perhaps even use the [0-9a-fx]* pattern for the SIZEOF_HEADERS line too. I was initially looking at my ld --verbose and trying to think what to do with the SEGMENT_START("text-segment", 0x08048000) pattern, but that's clearly dumb, since that implies that the -Ttext-segment option exists and works. :-P r~