From 09633cac697e37d770b2b666ab20cab30628484f Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 14 Jul 2012 01:24:14 -0700 Subject: [PATCH] altos/stm: Force STM stack to start at the top of RAM Using a fixed size means crashing if there's not enough space for that, or wasting memory if there's too much. Signed-off-by: Keith Packard --- src/stm/altos-ram.ld | 4 +--- src/stm/altos.ld | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/stm/altos-ram.ld b/src/stm/altos-ram.ld index b8fffedc..1143a08b 100644 --- a/src/stm/altos-ram.ld +++ b/src/stm/altos-ram.ld @@ -19,8 +19,6 @@ MEMORY { ram (rwx) : ORIGIN = 0x20000000, LENGTH = 16K } -C_STACK_SIZE = 512; - INCLUDE registers.ld SECTIONS { @@ -59,7 +57,7 @@ SECTIONS { __bss_end__ = .; } >ram - PROVIDE(__stack__ = . + C_STACK_SIZE); + PROVIDE(__stack__ = ORIGIN(ram) + LENGTH(ram)); PROVIDE(end = .); } diff --git a/src/stm/altos.ld b/src/stm/altos.ld index 7fede558..f5a84f4c 100644 --- a/src/stm/altos.ld +++ b/src/stm/altos.ld @@ -23,7 +23,6 @@ MEMORY { INCLUDE registers.ld EXTERN (stm_interrupt_vector) -C_STACK_SIZE = 512; SECTIONS { . = ORIGIN(rom); @@ -62,7 +61,7 @@ SECTIONS { __bss_end__ = .; } >ram - PROVIDE(__stack__ = . + C_STACK_SIZE); + PROVIDE(__stack__ = ORIGIN(ram) + LENGTH(ram)); PROVIDE(end = .); } -- 2.30.2