arm: Fix linker script stack section

Этот коммит содержится в:
Ayke van Laethem 2018-05-28 10:55:14 +02:00
родитель 2fca772431
коммит b45ea2deb9

18
arm.ld
Просмотреть файл

@ -5,6 +5,7 @@ MEMORY
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 16K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 16K
} }
_stack_size = 2K;
/* define output sections */ /* define output sections */
SECTIONS SECTIONS
@ -23,15 +24,14 @@ SECTIONS
_etext = .; /* define a global symbol at end of code */ _etext = .; /* define a global symbol at end of code */
} >FLASH_TEXT } >FLASH_TEXT
/* used by the startup to initialize data */
_sidata = LOADADDR(.data);
/* Put the stack at the bottom of RAM, so that the application will /* Put the stack at the bottom of RAM, so that the application will
* crash on stack overflow instead of silently corrupting memory. * crash on stack overflow instead of silently corrupting memory.
* See: http://blog.japaric.io/stack-overflow-protection/ */ * See: http://blog.japaric.io/stack-overflow-protection/ */
.stack : .stack :
{ {
KEEP(*(.stack)) . = ALIGN(4);
. += _stack_size;
__StackTop = .;
} >RAM } >RAM
/* This is the initialized data section /* This is the initialized data section
@ -62,10 +62,16 @@ SECTIONS
_ebss = .; /* define a global symbol at bss end; used by startup code and GC */ _ebss = .; /* define a global symbol at bss end; used by startup code and GC */
} >RAM } >RAM
.ARM.attributes 0 : { *(.ARM.attributes) } /DISCARD/ :
{
*(.ARM.exidx.*)
*(.ARM.attributes)
*(.stack) /* from nrfx */
*(.heap) /* from nrfx */
}
} }
/* For the nrfx startup file */ /* For the nrfx startup file. */
__etext = _etext; __etext = _etext;
__data_start__ = _sdata; __data_start__ = _sdata;
__bss_start__ = _sbss; __bss_start__ = _sbss;