Merge #208
208: linker: add sram origin symbol r=bradjc a=bradjc
This allows elf2tab to determine what the start of RAM address is when generating a fixed address header in the TBF.
See https://github.com/tock/elf2tab/pull/23 and https://github.com/tock/tock/pull/1845.
Co-authored-by: Brad Campbell <bradjc5@gmail.com>
diff --git a/layout_generic.ld b/layout_generic.ld
index 35b10f4..dd101ab 100644
--- a/layout_generic.ld
+++ b/layout_generic.ld
@@ -88,6 +88,15 @@
/* Application stack */
.stack (NOLOAD) :
{
+ /* elf2tab requires that the `_sram_origin` symbol be present to
+ * mark the first address in the SRAM memory. Since ELF files do
+ * not really need to specify this address as they only care about
+ * loading into flash, we need to manually mark this address for
+ * elf2tab. elf2tab will use it to add a fixed address header in the
+ * TBF header if needed.
+ */
+ _sram_origin = .;
+
. = . + STACK_SIZE;
_stack_top_unaligned = .;