Added mising sections to the linker.ld file.
Added the bss, heap and stack sections.
This commit is contained in:
parent
1a980a9ffd
commit
bfe0676079
45
linker.ld
45
linker.ld
|
@ -10,6 +10,14 @@
|
|||
*/
|
||||
ENTRY(Reset_Handler)
|
||||
|
||||
/* Highest address of user mode stack */
|
||||
_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */
|
||||
|
||||
/* Generate a link error if heap and stack don't fit into RAM */
|
||||
_Min_Heap_Size = 0x200; /* required amount of heap. */
|
||||
_Min_Stack_Size = 0x400; /* required amount of stack. */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* FORMAT:
|
||||
|
@ -34,11 +42,14 @@ MEMORY
|
|||
SRAM(rwx): ORIGIN = 0x20000000, LENGTH = 20K
|
||||
}
|
||||
|
||||
/* VMA: virtual memory address.*/
|
||||
/* LMA: Load memory address. */
|
||||
|
||||
floating_point = 0;
|
||||
SECTIONS
|
||||
{
|
||||
/* Code section, mapped to Flash memory */
|
||||
.tect :
|
||||
.text :
|
||||
{
|
||||
KEEP(*(.isr_vector)) /* Vector table, which must be at the beginning of Flash*/
|
||||
*(.text) /* All code goes here */
|
||||
|
@ -53,6 +64,36 @@ SECTIONS
|
|||
*(.data) /* Initialized data */
|
||||
_edata = .; /* End of data section */
|
||||
} > RAM AT > FLASH
|
||||
|
||||
/* BSS: Placed in SRAM memory types. */
|
||||
.bss :
|
||||
{
|
||||
_sbss = .; /* */
|
||||
*(.bss) /**/
|
||||
*(COMMON) /**/
|
||||
_ebss = .; /**/
|
||||
} > RAM
|
||||
|
||||
/* Stack Section: */
|
||||
._stack :
|
||||
{
|
||||
. = ALIGN(8); /**/
|
||||
_estack = .; /**/
|
||||
. = . + 2048; /**/
|
||||
_sstack = .; /**/
|
||||
} > RAM
|
||||
|
||||
/* Heap Section: */
|
||||
.heap :
|
||||
{
|
||||
_sheap = .; /**/
|
||||
. = . + 2048; /**/
|
||||
_eheap = .; /**/
|
||||
} > RAM
|
||||
}
|
||||
|
||||
|
||||
/* Provide symbols to be used in the startup code */
|
||||
PROVIDE(_stack_start = _sstack);
|
||||
PROVIDE(_stack_end = _estack);
|
||||
PROVIDE(_heap_start = _sheap);
|
||||
PROVIDE(_heap_end = _eheap);
|
||||
|
|
Loading…
Reference in New Issue