cc2538: Move the stack out of .bss

The initialization code clearing .bss is allowed to use the stack, so
the stack can not be in .bss, or this code will badly fail if it uses
the stack.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
This commit is contained in:
Benoît Thébaudeau 2015-05-23 18:25:33 +02:00
parent 0de729572b
commit 609c615303
2 changed files with 6 additions and 1 deletions

View File

@ -106,6 +106,11 @@ SECTIONS
_ebss = .;
} > SRAM
.stack (NOLOAD) :
{
*(.stack)
} > SRAM
#if (LPM_CONF_MAX_PM==2) && (LPM_CONF_ENABLE != 0)
.nrdata (NOLOAD) :
{

View File

@ -89,7 +89,7 @@ void uart1_isr(void) WEAK_ALIAS(default_handler);
#endif
/*---------------------------------------------------------------------------*/
/* Allocate stack space */
static unsigned long stack[512];
static unsigned long stack[512] __attribute__ ((section(".stack")));
/*---------------------------------------------------------------------------*/
/* Linker construct indicating .text section location */
extern uint8_t _text[0];