diff options
author | Keith Packard <keithp@keithp.com> | 2012-07-14 01:24:14 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-07-14 01:24:14 -0700 |
commit | 09633cac697e37d770b2b666ab20cab30628484f (patch) | |
tree | 70b4ed61439258a6266775099f6de4f401872559 /src | |
parent | b5f6d4e5251a825395c93916afa3af659c678498 (diff) |
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 <keithp@keithp.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/stm/altos-ram.ld | 4 | ||||
-rw-r--r-- | 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 = .); } |