Skip to content

Instantly share code, notes, and snippets.

@harryzhurov
Created May 3, 2017 12:07
Show Gist options
  • Save harryzhurov/10e76772643b6d6684ad05eb1bad7f1e to your computer and use it in GitHub Desktop.
Save harryzhurov/10e76772643b6d6684ad05eb1bad7f1e to your computer and use it in GitHub Desktop.
ENTRY(Reset_Handler)
_Minimum_Stack_Size = 0x100 ;
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 112K
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
}
PROVIDE ( __top_of_stack = ALIGN(ORIGIN(RAM) + LENGTH(RAM) - 8 ,8) );
SECTIONS
{
.isr_vector :
{
. = ALIGN(4);
KEEP(*(.isr_vector))
. = ALIGN(4);
} > FLASH
.text :
{
__init_array_start = .;
KEEP(SORT(*)(.init_array))
__init_array_end = .;
. = ALIGN(4);
*(.text)
*(.text.*)
*(.eh_frame_hdr)
*(.eh_frame)
*(.ARM.extab* .gnu.linkonce.armextab.*)
*(.gcc_except_table)
*(.eh_frame_hdr)
*(.eh_frame)
*(.glue_7)
*(.glue_7t)
. = ALIGN(4);
} > FLASH
.rodata :
{
*(.rodata)
*(.rodata.*)
} > FLASH
__exidx_start = .;
.ARM.exidx :
{
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
} > FLASH
__exidx_end = .;
.text.align :
{
. = ALIGN(8);
__text_end = .;
__idata_start = __text_end;
} > FLASH
.ramfunc :
{
. = ALIGN(4);
__data_start = .;
*(.ramfunc)
*(.ramfunc.*)
} > RAM AT > FLASH
.data :
{
. = ALIGN(4);
*(.data)
*(.data.*)
. = ALIGN(4);
__data_end = .;
} > RAM AT > FLASH
.bss :
{
. = ALIGN(4);
__bss_start = .;
*(.bss)
*(.bss.*)
*(COMMON)
. = ALIGN(4);
__bss_end = .;
} > RAM
._usrstack :
{
. = ALIGN(4);
_susrstack = . ;
. = . + _Minimum_Stack_Size ;
. = ALIGN(4);
_eusrstack = . ;
} >RAM
PROVIDE( _heap = _ebss );
PROVIDE ( _eheap = ALIGN(ORIGIN(RAM) + LENGTH(RAM) - 8 - _Minimum_Stack_Size , 8) );
DISCARD :
{
libc.a ( * )
libm.a ( * )
libgcc.a ( * )
}
.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) }
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
.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) }
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment