131 lines
3.0 KiB
Plaintext
131 lines
3.0 KiB
Plaintext
/* Linker script to configure memory regions. */
|
|
|
|
MEMORY
|
|
{
|
|
ROM (rx) : ORIGIN = 0x00000000, LENGTH = 0x80000 /* 512K FLASH */
|
|
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 0x10000 /* 64K RAM */
|
|
}
|
|
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);
|
|
|
|
PROVIDE(__ctors_start__ = .);
|
|
KEEP (*(SORT(.init_array.*)))
|
|
KEEP (*(.init_array))
|
|
PROVIDE(__ctors_end__ = .);
|
|
|
|
. = ALIGN(4);
|
|
|
|
_etext = .;
|
|
} > ROM = 0
|
|
|
|
/* .ARM.exidx is sorted, so has to go in its own output section. */
|
|
__exidx_start = .;
|
|
.ARM.exidx :
|
|
{
|
|
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
|
|
|
/* This is used by the startup in order to initialize the .data secion */
|
|
_sidata = .;
|
|
} > ROM
|
|
__exidx_end = .;
|
|
|
|
/* .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 = . ;
|
|
|
|
*(.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
|
|
|
|
.stack :
|
|
{
|
|
. = 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 = . ;
|
|
|
|
*(.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);
|
|
}
|