2021-01-31 10:01:10 +08:00
|
|
|
/* Linker script to configure memory regions. */
|
|
|
|
|
|
|
|
MEMORY
|
|
|
|
{
|
2021-06-28 00:49:42 +08:00
|
|
|
ROM (rx) : ORIGIN = 0x00000000, LENGTH = 0x80000 /* 512K FLASH */
|
|
|
|
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 0x10000 /* 64K RAM */
|
2021-01-31 10:01:10 +08:00
|
|
|
}
|
2021-06-28 00:49:42 +08:00
|
|
|
ENTRY(Reset_Handler)
|
|
|
|
_system_stack_size = 0x200;
|
|
|
|
|
|
|
|
SECTIONS
|
|
|
|
{
|
|
|
|
.text :
|
|
|
|
{
|
|
|
|
. = ALIGN(4);
|
|
|
|
_stext = .;
|
|
|
|
KEEP(*(.isr_vector)) /* Startup code */
|
|
|
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
*(.text) /* remaining code */
|
|
|
|
*(.text.*) /* remaining code */
|
|
|
|
*(.rodata) /* read-only data (constants) */
|
|
|
|
*(.rodata*)
|
|
|
|
*(.glue_7)
|
|
|
|
*(.glue_7t)
|
|
|
|
*(.gnu.linkonce.t*)
|
|
|
|
|
|
|
|
/* section information for finsh shell */
|
|
|
|
. = ALIGN(4);
|
|
|
|
__fsymtab_start = .;
|
|
|
|
KEEP(*(FSymTab))
|
|
|
|
__fsymtab_end = .;
|
|
|
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
__vsymtab_start = .;
|
|
|
|
KEEP(*(VSymTab))
|
|
|
|
__vsymtab_end = .;
|
|
|
|
|
|
|
|
/* section information for initial. */
|
|
|
|
. = ALIGN(4);
|
|
|
|
__rt_init_start = .;
|
|
|
|
KEEP(*(SORT(.rti_fn*)))
|
|
|
|
__rt_init_end = .;
|
|
|
|
|
|
|
|
/* section information for modules */
|
|
|
|
. = ALIGN(4);
|
|
|
|
__rtmsymtab_start = .;
|
|
|
|
KEEP(*(RTMSymTab))
|
|
|
|
__rtmsymtab_end = .;
|
|
|
|
|
|
|
|
. = ALIGN(4);
|
2023-01-09 10:16:47 +08:00
|
|
|
|
2021-06-28 00:49:42 +08:00
|
|
|
PROVIDE(__ctors_start__ = .);
|
|
|
|
KEEP (*(SORT(.init_array.*)))
|
|
|
|
KEEP (*(.init_array))
|
|
|
|
PROVIDE(__ctors_end__ = .);
|
|
|
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
|
|
|
|
_etext = .;
|
|
|
|
} > ROM = 0
|
2021-01-31 10:01:10 +08:00
|
|
|
|
2021-06-28 00:49:42 +08:00
|
|
|
/* .ARM.exidx is sorted, so has to go in its own output section. */
|
|
|
|
__exidx_start = .;
|
|
|
|
.ARM.exidx :
|
|
|
|
{
|
|
|
|
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
2021-01-31 10:01:10 +08:00
|
|
|
|
2021-06-28 00:49:42 +08:00
|
|
|
/* This is used by the startup in order to initialize the .data secion */
|
|
|
|
_sidata = .;
|
|
|
|
} > ROM
|
|
|
|
__exidx_end = .;
|
2021-01-31 10:01:10 +08:00
|
|
|
|
2021-06-28 00:49:42 +08:00
|
|
|
/* .data section which is used for initialized data */
|
|
|
|
.data : AT (_sidata)
|
|
|
|
{
|
|
|
|
. = ALIGN(4);
|
|
|
|
/* This is used by the startup in order to initialize the .data secion */
|
|
|
|
_sdata = . ;
|
2021-01-31 10:01:10 +08:00
|
|
|
|
2021-06-28 00:49:42 +08:00
|
|
|
*(.data)
|
|
|
|
*(.data.*)
|
|
|
|
*(.gnu.linkonce.d*)
|
|
|
|
|
|
|
|
PROVIDE(__dtors_start__ = .);
|
|
|
|
KEEP(*(SORT(.dtors.*)))
|
|
|
|
KEEP(*(.dtors))
|
|
|
|
PROVIDE(__dtors_end__ = .);
|
|
|
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
/* This is used by the startup in order to initialize the .data secion */
|
|
|
|
_edata = . ;
|
|
|
|
} >RAM
|
|
|
|
|
2023-01-09 10:16:47 +08:00
|
|
|
.stack :
|
2021-06-28 00:49:42 +08:00
|
|
|
{
|
|
|
|
. = ALIGN(4);
|
|
|
|
_sstack = .;
|
|
|
|
. = . + _system_stack_size;
|
|
|
|
. = ALIGN(4);
|
|
|
|
_estack = .;
|
|
|
|
} >RAM
|
|
|
|
|
|
|
|
__bss_start = .;
|
|
|
|
.bss :
|
|
|
|
{
|
|
|
|
. = ALIGN(4);
|
|
|
|
/* This is used by the startup in order to initialize the .bss secion */
|
|
|
|
_sbss = .;
|
|
|
|
|
|
|
|
*(.bss)
|
|
|
|
*(.bss.*)
|
|
|
|
*(COMMON)
|
|
|
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
/* This is used by the startup in order to initialize the .bss secion */
|
|
|
|
_ebss = . ;
|
2023-01-09 10:16:47 +08:00
|
|
|
|
2021-06-28 00:49:42 +08:00
|
|
|
*(.bss.init)
|
|
|
|
} > RAM
|
|
|
|
__bss_end = .;
|
|
|
|
|
|
|
|
_end = .;
|
|
|
|
|
|
|
|
PROVIDE(__etext = __exidx_end);
|
|
|
|
PROVIDE(__data_start__ = _sdata);
|
|
|
|
PROVIDE(__bss_start__ = __bss_start);
|
|
|
|
PROVIDE(__bss_end__ = __bss_end);
|
|
|
|
PROVIDE(__StackTop = _estack);
|
|
|
|
}
|