summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/cortex-m/ec.lds.S8
-rw-r--r--core/cortex-m0/ec.lds.S8
-rw-r--r--core/nds32/ec.lds.S12
3 files changed, 27 insertions, 1 deletions
diff --git a/core/cortex-m/ec.lds.S b/core/cortex-m/ec.lds.S
index 0c570a0b14..803845c5a6 100644
--- a/core/cortex-m/ec.lds.S
+++ b/core/cortex-m/ec.lds.S
@@ -329,6 +329,14 @@ SECTIONS
* can expand to use all the remaining RAM. */
__shared_mem_buf = .;
+ /* Tag at end of firmware image so that we can find the image size.
+ * This may be overwritten by the shared memory buffer; that's ok
+ * because we only use it to find the image size in flash. */
+ . = ALIGN(4);
+ BYTE(0x45);
+ BYTE(0x4e);
+ BYTE(0x44);
+ BYTE(0xea);
/* NOTHING MAY GO AFTER THIS! */
} > IRAM
diff --git a/core/cortex-m0/ec.lds.S b/core/cortex-m0/ec.lds.S
index 495395a572..ee65cb31ce 100644
--- a/core/cortex-m0/ec.lds.S
+++ b/core/cortex-m0/ec.lds.S
@@ -217,6 +217,14 @@ SECTIONS
* can expand to use all the remaining RAM. */
__shared_mem_buf = .;
+ /* Tag at end of firmware image so that we can find the image size.
+ * This may be overwritten by the shared memory buffer; that's ok
+ * because we only use it to find the image size in flash. */
+ . = ALIGN(4);
+ BYTE(0x45);
+ BYTE(0x4e);
+ BYTE(0x44);
+ BYTE(0xea);
/* NOTHING MAY GO AFTER THIS! */
} > IRAM
diff --git a/core/nds32/ec.lds.S b/core/nds32/ec.lds.S
index 735d4e5c8b..978f652815 100644
--- a/core/nds32/ec.lds.S
+++ b/core/nds32/ec.lds.S
@@ -218,7 +218,17 @@ SECTIONS
} > IRAM
- /* TODO: Add __image_size. */
+ .flash.tag : {
+ /* Tag at end of firmware image so that we can find the image size.
+ * This may be overwritten by the shared memory buffer; that's ok
+ * because we only use it to find the image size in flash. */
+ . = ALIGN(4);
+ BYTE(0x45);
+ BYTE(0x4e);
+ BYTE(0x44);
+ BYTE(0xea);
+ /* NOTHING MAY GO IN FLASH AFTER THIS! */
+ } >FLASH
#ifdef CONFIG_LPC
.h2ram (NOLOAD) : {