aducrf101: Rearrange stack and heap to maximize available stack space

Stack now starts at the top of RAM, heap starts after BSS, and
they grow towards each other.
This commit is contained in:
Jim Paris 2014-07-29 18:06:43 -04:00
parent 62b8aafb03
commit 3e193cca2c
2 changed files with 5 additions and 13 deletions

View file

@ -91,10 +91,8 @@ SECTIONS
} > ram AT > flash } > ram AT > flash
.bss : { .bss : {
/* Stack is in BSS */
. = ALIGN(8); . = ALIGN(8);
__bss_start = .; __bss_start = .;
*(.bss.stack)
*(.bss) *(.bss)
*(.bss.*) *(.bss.*)
*(COMMON) *(COMMON)
@ -102,4 +100,9 @@ SECTIONS
__bss_end = .; __bss_end = .;
end = .; end = .;
} > ram } > ram
/* Heap grows up from "end" (after bss), and stack grows down from
the end of RAM. */
. = ORIGIN(ram) + LENGTH(ram);
stack_end = .;
} }

View file

@ -32,19 +32,8 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef __STACK_SIZE
#define __STACK_SIZE 1024
#endif
.equ SCB_VTOR, 0xE000ED08 .equ SCB_VTOR, 0xE000ED08
/* Stack */
.section .bss.stack
stack_start:
.space __STACK_SIZE, 0
stack_end:
.global stack_end
/* Vector table */ /* Vector table */
.macro handler name .macro handler name
.long \name\() .long \name\()