|
|
|
/*
|
|
|
|
* linker script for STM32F4xx with GNU ld
|
|
|
|
*/
|
|
|
|
|
|
|
|
MEMORY
|
|
|
|
{
|
|
|
|
VECTOR (rx) : ORIGIN = ONCHIP_FLASH_START, LENGTH = 1K /* 1KB flash */
|
|
|
|
FLASH (rx) : ORIGIN = ONCHIP_FLASH_START + 1K, LENGTH = ONCHIP_FLASH_SIZE - 1K /* 1024KB flash */
|
|
|
|
SRAM (rw) : ORIGIN = 0x20000000, LENGTH = 192K /* 192K sram */
|
|
|
|
CCRAM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K
|
|
|
|
}
|
|
|
|
|
|
|
|
ENTRY(Reset_Handler)
|
|
|
|
_system_stack_size = DEFINED(_system_stack_size) ? _system_stack_size : 1024;
|
|
|
|
|
|
|
|
SECTIONS
|
|
|
|
{
|
|
|
|
.vector :
|
|
|
|
{
|
|
|
|
_sivector = LOADADDR(.vector);
|
|
|
|
_svector = .;
|
|
|
|
KEEP(*(.isr_vector)) /* Startup code */
|
|
|
|
_evector = .;
|
|
|
|
} > VECTOR
|
|
|
|
|
|
|
|
.text :
|
|
|
|
{
|
|
|
|
. = ALIGN(4);
|
|
|
|
_stext = .;
|
|
|
|
*(.text.Reset_Handler)
|
|
|
|
/* KEEP(*(.isr_vector)) /1* Startup code *1/ */
|
|
|
|
/* . = ALIGN(4); */
|
|
|
|
*(.text*) /* remaining code */
|
|
|
|
*(.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 = .;
|
|
|
|
. = ALIGN(4);
|
|
|
|
|
|
|
|
/* section information for initial. */
|
|
|
|
. = ALIGN(4);
|
|
|
|
__rt_init_start = .;
|
|
|
|
KEEP(*(SORT(.rti_fn*)))
|
|
|
|
__rt_init_end = .;
|
|
|
|
|
|
|
|
/* lists of constructors and destructors */
|
|
|
|
. = ALIGN(4);
|
|
|
|
PROVIDE_HIDDEN ( __preinit_array_start = . );
|
|
|
|
KEEP (*(.preinit_array))
|
|
|
|
PROVIDE_HIDDEN ( __preinit_array_end = . );
|
|
|
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
PROVIDE_HIDDEN ( __init_array_start = . );
|
|
|
|
PROVIDE_HIDDEN ( __ctors_start__ = . );
|
|
|
|
KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
|
|
|
|
KEEP (*(.init_array .ctors))
|
|
|
|
PROVIDE_HIDDEN ( __ctors_end__ = . );
|
|
|
|
PROVIDE_HIDDEN ( __init_array_end = . );
|
|
|
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
PROVIDE_HIDDEN ( __fini_array_start = . );
|
|
|
|
KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
|
|
|
|
KEEP (*(.fini_array .dtors))
|
|
|
|
PROVIDE_HIDDEN ( __fini_array_end = . );
|
|
|
|
. = ALIGN(4);
|
|
|
|
|
|
|
|
_etext = .;
|
|
|
|
} > FLASH = 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 = .;
|
|
|
|
} > FLASH
|
|
|
|
__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*)
|
|
|
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
/* This is used by the startup in order to initialize the .data secion */
|
|
|
|
_edata = . ;
|
|
|
|
} >SRAM
|
|
|
|
|
|
|
|
.stack :
|
|
|
|
{
|
|
|
|
. = ALIGN(8);
|
|
|
|
. = . + _system_stack_size;
|
|
|
|
. = ALIGN(8);
|
|
|
|
_estack = .;
|
|
|
|
} >SRAM
|
|
|
|
|
|
|
|
__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)
|
|
|
|
} > SRAM
|
|
|
|
__bss_end = .;
|
|
|
|
|
|
|
|
_end = ALIGN(128);
|
|
|
|
__heap_start = .;
|
|
|
|
|
|
|
|
__heap_end = ORIGIN(SRAM) + LENGTH(SRAM);
|
|
|
|
__ram_end__ = ORIGIN(SRAM) + LENGTH(SRAM) - 1;
|
|
|
|
|
|
|
|
/* Stabs debugging sections. */
|
|
|
|
.stab 0 : { *(.stab) }
|
|
|
|
.stabstr 0 : { *(.stabstr) }
|
|
|
|
.stab.excl 0 : { *(.stab.excl) }
|
|
|
|
.stab.exclstr 0 : { *(.stab.exclstr) }
|
|
|
|
.stab.index 0 : { *(.stab.index) }
|
|
|
|
.stab.indexstr 0 : { *(.stab.indexstr) }
|
|
|
|
.comment 0 : { *(.comment) }
|
|
|
|
/* DWARF debug sections.
|
|
|
|
* Symbols in the DWARF debugging sections are relative to the beginning
|
|
|
|
* of the section so we begin them at 0. */
|
|
|
|
/* DWARF 1 */
|
|
|
|
.debug 0 : { *(.debug) }
|
|
|
|
.line 0 : { *(.line) }
|
|
|
|
/* GNU DWARF 1 extensions */
|
|
|
|
.debug_srcinfo 0 : { *(.debug_srcinfo) }
|
|
|
|
.debug_sfnames 0 : { *(.debug_sfnames) }
|
|
|
|
/* DWARF 1.1 and DWARF 2 */
|
|
|
|
.debug_aranges 0 : { *(.debug_aranges) }
|
|
|
|
.debug_pubnames 0 : { *(.debug_pubnames) }
|
|
|
|
/* DWARF 2 */
|
|
|
|
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
|
|
|
|
.debug_abbrev 0 : { *(.debug_abbrev) }
|
|
|
|
.debug_line 0 : { *(.debug_line) }
|
|
|
|
.debug_frame 0 : { *(.debug_frame) }
|
|
|
|
.debug_str 0 : { *(.debug_str) }
|
|
|
|
.debug_loc 0 : { *(.debug_loc) }
|
|
|
|
.debug_macinfo 0 : { *(.debug_macinfo) }
|
|
|
|
/* SGI/MIPS DWARF 2 extensions */
|
|
|
|
.debug_weaknames 0 : { *(.debug_weaknames) }
|
|
|
|
.debug_funcnames 0 : { *(.debug_funcnames) }
|
|
|
|
.debug_typenames 0 : { *(.debug_typenames) }
|
|
|
|
.debug_varnames 0 : { *(.debug_varnames) }
|
|
|
|
}
|