valgrind.vs \
README_MODULES.txt
+BUILT_SOURCES = stage2.lds
+CLEANFILES = stage2.lds
+
valgrind_SOURCES = \
ume.c \
\
-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) \
-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:
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 $@
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 $@
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 $@
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)