From cc0ccdd121acec8bf194fc967b2e4a4e6371b209 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Fr=C3=B6schle?= Date: Tue, 5 Nov 2013 06:31:35 +0000 Subject: [PATCH] changed bas_rom memory flags to WX when compiling to RAM. Should fix global variables problem since .bss was previously mapped to nonexistant memory locations with ld trying to be smart --- BaS_gcc/bas.lk.in | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/BaS_gcc/bas.lk.in b/BaS_gcc/bas.lk.in index ad5f384..7e78d11 100644 --- a/BaS_gcc/bas.lk.in +++ b/BaS_gcc/bas.lk.in @@ -6,10 +6,16 @@ #include "m5484l.h" #endif /* MACHINE_M5484LITE */ +/* make bas_rom access flags rx if compiling to RAM */ +#if (TARGET_ADDRESS < 0x1FFFFFFF && TARGET_ADDRESS > 0) +#define ROMFLAGS WX +#else +#define ROMFLAGS RX +#endif /* TARGET_ADDRESS */ MEMORY { - bas_rom (RX) : ORIGIN = TARGET_ADDRESS, LENGTH = 0x00100000 + bas_rom (ROMFLAGS) : ORIGIN = TARGET_ADDRESS, LENGTH = 0x00100000 /* * target to copy BaS data segment to. 20k should be enough for now */