|
From: <sv...@va...> - 2005-06-21 03:30:52
|
Author: njn Date: 2005-06-21 04:30:51 +0100 (Tue, 21 Jun 2005) New Revision: 3980 Log: Attempt to fix the stage2.lds borkage. Modified: trunk/coregrind/Makefile.am Modified: trunk/coregrind/Makefile.am =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/coregrind/Makefile.am 2005-06-21 03:20:17 UTC (rev 3979) +++ trunk/coregrind/Makefile.am 2005-06-21 03:30:51 UTC (rev 3980) @@ -183,13 +183,23 @@ -Wl,-z,initfirst =20 # Extract ld's default linker script and hack it to our needs. -# This relies on finding "executable_start" and replacing the address on -# that line with kickstart_base. +# First we cut everything above and below the "=3D=3D=3D=3D=3D..." lines= at the top +# and bottom. +# Then we have to replace the load address with "kickstart_base". +# The line to replace in has one of the following two forms: +# +# . =3D 0x08048000 + SIZEOF_HEADERS; +# +# or +# PROVIDE (__executable_start =3D 0x08048000); . =3D 0x08048000 + SIZE= OF_HEADERS; +# +# So we search for the line with a hex value "+ SIZEOF_HEADERS", and rep= lace +# all the hex values in that line with "kickstart_base". stage2.lds: Makefile $(CC) -Wl,--verbose -nostdlib 2>&1 | sed \ -e '1,/^=3D=3D=3D=3D=3D\+$$/d' \ -e '/^=3D=3D=3D=3D=3D\+$$/d' \ - -e '/executable_start/s/0x[0-9A-Fa-f]\+/kickstart_base/g' > $@ \ + -e '/\. =3D 0x[0-9A-Fa-f]\+ + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/kicksta= rt_base/g' > $@ \ || rm -f $@ =20 MANUAL_DEPS =3D $(noinst_HEADERS) $(include_HEADERS) |