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~