]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Make the stage2.lds building platform-independent by not trying to match
authorNicholas Nethercote <njn@valgrind.org>
Sat, 18 Jun 2005 16:41:30 +0000 (16:41 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Sat, 18 Jun 2005 16:41:30 +0000 (16:41 +0000)
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.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3939

coregrind/Makefile.am
coregrind/amd64/Makefile.am
coregrind/arm/Makefile.am
coregrind/x86/Makefile.am
memcheck/tests/Makefile.am

index be6ea6799f41a1bdd51f389210dbe41843e76c87..214c2671277d788d2d808107e26594148f1e10ee 100644 (file)
@@ -83,6 +83,9 @@ EXTRA_DIST = \
        valgrind.vs \
        README_MODULES.txt
 
+BUILT_SOURCES = stage2.lds
+CLEANFILES = stage2.lds
+       
 valgrind_SOURCES = \
        ume.c \
        \
@@ -159,11 +162,11 @@ stage2_LDFLAGS = \
        -Wl,--whole-archive $(stage2_extra2) -Wl,--no-whole-archive \
        -pie
 else
-stage2_DEPENDENCIES = $(st2_DEPS_common) ${VG_ARCH}/stage2.lds
+stage2_DEPENDENCIES = $(st2_DEPS_common) stage2.lds
 stage2_LDFLAGS = \
        $(st2_LDFLAGS_common) \
        -Wl,--whole-archive $(stage2_extra2) -Wl,--no-whole-archive \
-       -Wl,-defsym,kickstart_base=@KICKSTART_BASE@ -Wl,-T,${VG_ARCH}/stage2.lds
+       -Wl,-defsym,kickstart_base=@KICKSTART_BASE@ -Wl,-T,stage2.lds
 endif
 
 stage2_LDADD= $(stage2_extra) \
@@ -177,6 +180,16 @@ vg_preload_core_so_LDFLAGS = \
        -Wl,--soname,vg_preload_core.so \
        -Wl,-z,initfirst
 
+# 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,/^=====\+$$/d' \
+               -e '/^=====\+$$/d' \
+               -e '/executable_start/s/0x[0-9A-Fa-f]\+/kickstart_base/g' > $@ \
+       || rm -f $@
+
 MANUAL_DEPS = $(noinst_HEADERS) $(include_HEADERS)
 
 all-local:
index ff0495287550671057d9a343989e09beca3a8c6c..8306f657e898c80a2600c16eda0ff3c932f5fffd 100644 (file)
@@ -3,15 +3,6 @@ include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am
 
 noinst_LIBRARIES = libarch.a
 
-BUILT_SOURCES = stage2.lds
-CLEANFILES = stage2.lds
-
 libarch_a_SOURCES = \
        cpuid.S
 
-# Extract ld's default linker script and hack it to our needs
-stage2.lds: Makefile
-       $(CC) -Wl,--verbose -nostdlib 2>&1 | sed \
-               -e '1,/^=====\+$$/d' \
-               -e '/^=====\+$$/d' \
-               -e 's/0x400000/kickstart_base/g' > $@ || rm -f $@
index 3b0144aafa370eba04913166a360096dfea74c6e..da669e95270082f4050836e54cd9a0e748a7c2d3 100644 (file)
@@ -3,14 +3,5 @@ include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am
 
 noinst_LIBRARIES = libarch.a
 
-BUILT_SOURCES = stage2.lds
-CLEANFILES = stage2.lds
-
 libarch_a_SOURCES =
 
-# Extract ld's default linker script and hack it to our needs
-stage2.lds: Makefile
-       $(CC) -Wl,--verbose -nostdlib 2>&1 | sed \
-               -e '1,/^=====\+$$/d' \
-               -e '/^=====\+$$/d' \
-               -e 's/0x00008000/kickstart_base/g' > $@ || rm -f $@
index 72a381fb37216671464f199877d9467390fa1f99..8306f657e898c80a2600c16eda0ff3c932f5fffd 100644 (file)
@@ -3,15 +3,6 @@ include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am
 
 noinst_LIBRARIES = libarch.a
 
-BUILT_SOURCES = stage2.lds
-CLEANFILES = stage2.lds
-
 libarch_a_SOURCES = \
        cpuid.S
 
-# 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,/^=====\+$$/d' \
-               -e '/^=====\+$$/d' \
-               -e 's/0x08048000/kickstart_base/g' > $@ || rm -f $@
index 588dcff5bb873155c8ad629b2ca08a4a7bf25dc2..62faa6d9d7b420fec2a64fadbf5973aa7daf488d 100644 (file)
@@ -196,8 +196,8 @@ hello_CFLAGS                = $(AM_CFLAGS) -fpie
 hello_LDFLAGS          = -pie
 else
 hello_LDFLAGS          = -Wl,-defsym,kickstart_base=0x50000000 \
-                         -Wl,-T,../../coregrind/${VG_ARCH}/stage2.lds
-hello_DEPENDENCIES     = ../../coregrind/${VG_ARCH}/stage2.lds
+                         -Wl,-T,../../coregrind/stage2.lds
+hello_DEPENDENCIES     = ../../coregrind/stage2.lds
 endif
 
 vgtest_ume_CFLAGS      = -DVGA_$(VG_ARCH)