Platform: Simplify ARMCLANG - IAR compatibility
ARMCLANG defines a number of special symbols, not normally defined
by IAR (or GCC). The IAR linker has no facility to define these
symbols in the linker script, like the Gnu linker. These symbols used
to be defined on the command line to the compiler through CMake, but it
was causing issues where bash was needed to execute the commands and it
was impossible to define these symbols in the IDE. Defining them in
region.h instead solves this.
Signed-off-by: TTornblom <thomas.tornblom@iar.com>
Change-Id: Iaffe21ac530df3316b1bf71aad392262f9cf8017
diff --git a/platform/include/region.h b/platform/include/region.h
index c6ca921..00d88a0 100644
--- a/platform/include/region.h
+++ b/platform/include/region.h
@@ -14,4 +14,25 @@
#define REGION_DECLARE(a, b, c) extern uint32_t REGION_NAME(a, b, c)
#define REGION_DECLARE_T(a, b, c, t) extern t REGION_NAME(a, b, c)
+#ifdef __ICCARM__
+/*
+ * ARMCLANG - IAR linker compatibility
+ */
+#define Image$$
+#define Load$$LR$$
+#define $$ZI$$Base $$Base
+#define $$ZI$$Limit $$Limit
+#define $$RO$$Base $$Base
+#define $$RO$$Limit $$Limit
+#define $$RW$$Base $$Base
+#define $$RW$$Limit $$Limit
+#define _DATA$$RW$$Base _DATA$$Base
+#define _DATA$$RW$$Limit _DATA$$Limit
+#define _DATA$$ZI$$Base _DATA$$Base
+#define _DATA$$ZI$$Limit _DATA$$Limit
+#define _STACK$$ZI$$Base _STACK$$Base
+#define _STACK$$ZI$$Limit _STACK$$Limit
+
+#endif /* __ICCARM__ */
+
#endif /* __REGION_H__ */