|
From: <sv...@va...> - 2005-06-18 16:41:36
|
Author: njn
Date: 2005-06-18 17:41:30 +0100 (Sat, 18 Jun 2005)
New Revision: 3939
Log:
Make the stage2.lds building platform-independent by not trying to match
an exact address (idea from Paul Mackerras' PPC port). Thus it could be
moved into coregrind/Makefile.am.
Let me know if this breaks anything on other platforms.
Modified:
trunk/coregrind/Makefile.am
trunk/coregrind/amd64/Makefile.am
trunk/coregrind/arm/Makefile.am
trunk/coregrind/x86/Makefile.am
trunk/memcheck/tests/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-18 15:54:25 UTC (rev 3938)
+++ trunk/coregrind/Makefile.am 2005-06-18 16:41:30 UTC (rev 3939)
@@ -83,6 +83,9 @@
valgrind.vs \
README_MODULES.txt
=20
+BUILT_SOURCES =3D stage2.lds
+CLEANFILES =3D stage2.lds
+=09
valgrind_SOURCES =3D \
ume.c \
\
@@ -159,11 +162,11 @@
-Wl,--whole-archive $(stage2_extra2) -Wl,--no-whole-archive \
-pie
else
-stage2_DEPENDENCIES =3D $(st2_DEPS_common) ${VG_ARCH}/stage2.lds
+stage2_DEPENDENCIES =3D $(st2_DEPS_common) stage2.lds
stage2_LDFLAGS =3D \
$(st2_LDFLAGS_common) \
-Wl,--whole-archive $(stage2_extra2) -Wl,--no-whole-archive \
- -Wl,-defsym,kickstart_base=3D@KICKSTART_BASE@ -Wl,-T,${VG_ARCH}/stage2.=
lds
+ -Wl,-defsym,kickstart_base=3D@KICKSTART_BASE@ -Wl,-T,stage2.lds
endif
=20
stage2_LDADD=3D $(stage2_extra) \
@@ -177,6 +180,16 @@
-Wl,--soname,vg_preload_core.so \
-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.
+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' > $@ \
+ || rm -f $@
+
MANUAL_DEPS =3D $(noinst_HEADERS) $(include_HEADERS)
=20
all-local:
Modified: trunk/coregrind/amd64/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/amd64/Makefile.am 2005-06-18 15:54:25 UTC (rev 3938)
+++ trunk/coregrind/amd64/Makefile.am 2005-06-18 16:41:30 UTC (rev 3939)
@@ -3,15 +3,6 @@
=20
noinst_LIBRARIES =3D libarch.a
=20
-BUILT_SOURCES =3D stage2.lds
-CLEANFILES =3D stage2.lds
-
libarch_a_SOURCES =3D \
cpuid.S
=20
-# Extract ld's default linker script and hack it to our needs
-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 's/0x400000/kickstart_base/g' > $@ || rm -f $@
Modified: trunk/coregrind/arm/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/arm/Makefile.am 2005-06-18 15:54:25 UTC (rev 3938)
+++ trunk/coregrind/arm/Makefile.am 2005-06-18 16:41:30 UTC (rev 3939)
@@ -3,14 +3,5 @@
=20
noinst_LIBRARIES =3D libarch.a
=20
-BUILT_SOURCES =3D stage2.lds
-CLEANFILES =3D stage2.lds
-
libarch_a_SOURCES =3D
=20
-# Extract ld's default linker script and hack it to our needs
-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 's/0x00008000/kickstart_base/g' > $@ || rm -f $@
Modified: trunk/coregrind/x86/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/x86/Makefile.am 2005-06-18 15:54:25 UTC (rev 3938)
+++ trunk/coregrind/x86/Makefile.am 2005-06-18 16:41:30 UTC (rev 3939)
@@ -3,15 +3,6 @@
=20
noinst_LIBRARIES =3D libarch.a
=20
-BUILT_SOURCES =3D stage2.lds
-CLEANFILES =3D stage2.lds
-
libarch_a_SOURCES =3D \
cpuid.S
=20
-# Extract ld's default linker script and hack it to our needs
-stage2.lds: Makefile
- $(CC) $(AM_CFLAGS) -Wl,--verbose -nostdlib 2>&1 | sed \
- -e '1,/^=3D=3D=3D=3D=3D\+$$/d' \
- -e '/^=3D=3D=3D=3D=3D\+$$/d' \
- -e 's/0x08048000/kickstart_base/g' > $@ || rm -f $@
Modified: trunk/memcheck/tests/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/memcheck/tests/Makefile.am 2005-06-18 15:54:25 UTC (rev 3938)
+++ trunk/memcheck/tests/Makefile.am 2005-06-18 16:41:30 UTC (rev 3939)
@@ -196,8 +196,8 @@
hello_LDFLAGS =3D -pie
else
hello_LDFLAGS =3D -Wl,-defsym,kickstart_base=3D0x50000000 \
- -Wl,-T,../../coregrind/${VG_ARCH}/stage2.lds
-hello_DEPENDENCIES =3D ../../coregrind/${VG_ARCH}/stage2.lds
+ -Wl,-T,../../coregrind/stage2.lds
+hello_DEPENDENCIES =3D ../../coregrind/stage2.lds
endif
=20
vgtest_ume_CFLAGS =3D -DVGA_$(VG_ARCH)
|