From: Nicholas Nethercote Date: Wed, 25 Aug 2004 16:16:56 +0000 (+0000) Subject: Change things so that stage2's location is controlled by a single variable. X-Git-Tag: svn/VALGRIND_2_2_0~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3df220384ada35c77ad1ed5524540aba5e600296;p=thirdparty%2Fvalgrind.git Change things so that stage2's location is controlled by a single variable. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2620 --- diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am index 8c889198a8..90ad962df0 100644 --- a/coregrind/Makefile.am +++ b/coregrind/Makefile.am @@ -7,7 +7,8 @@ add_includes = -I$(srcdir)/demangle -I$(top_builddir)/include \ valdir = $(libdir)/valgrind inplacedir = $(top_builddir)/.in_place -AM_CPPFLAGS = $(add_includes) -DVG_LIBDIR="\"$(valdir)"\" +AM_CPPFLAGS = $(add_includes) -DVG_LIBDIR="\"$(valdir)"\" \ + -DKICKSTART_BASE=$(KICKSTART_BASE) AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -O -fno-omit-frame-pointer \ @PREFERRED_STACK_BOUNDARY@ -g -DELFSZ=32 AM_CCASFLAGS = $(add_includes) -I.. @@ -40,6 +41,12 @@ valgrind_DEPENDENCIES = valgrind_LDFLAGS=-static -g -Wl,-e,_ume_entry valgrind_LDADD= +# Where stage2 will be put. +# Nb: Hard-wiring this sucks. A configure-time test would be better. A +# load-time test would be even better, but would require building stage2 in +# a position-independent way... +KICKSTART_BASE=0xb0000000 + stage2_SOURCES = \ ume.c \ x86/ume_entry.S \ @@ -80,7 +87,7 @@ stage2_SOURCES = \ vg_cpuid.S stage2_DEPENDENCIES = $(srcdir)/valgrind.vs x86/stage2.lds stage2_LDFLAGS=-Wl,--export-dynamic -Wl,-e,_ume_entry -g \ - -Wl,-defsym,kickstart_base=0xb0000000 \ + -Wl,-defsym,kickstart_base=$(KICKSTART_BASE) \ -Wl,-T,x86/stage2.lds \ -Wl,-version-script $(srcdir)/valgrind.vs stage2_LDADD= \ diff --git a/coregrind/stage1.c b/coregrind/stage1.c index 4fab73360f..9ec46639f5 100644 --- a/coregrind/stage1.c +++ b/coregrind/stage1.c @@ -180,7 +180,7 @@ static void hoops(void) - it could have a special PHDR (v. ELF specific) - something else? */ - info.map_base = 0xb1000000; + info.map_base = KICKSTART_BASE + 0x01000000; info.argv = NULL; snprintf(buf, sizeof(buf), "%s/%s", valgrind_lib, stage2);