1/* Program Entry, set to mark it as "used" and avoid gc */ 2MEMORY 3{ 4 CODE (rx) : ORIGIN = 0x08000000, LENGTH = 128k /* 128KB flash */ 5 DATA (rw) : ORIGIN = 0x20000000, LENGTH = 20k /* 8K sram */ 6} 7ENTRY(Reset_Handler) 8_system_stack_size = 0x200; 9 10SECTIONS 11{ 12 .text : 13 { 14 . = ALIGN(4); 15 _stext = .; 16 KEEP(*(.isr_vector)) /* Startup code */ 17 . = ALIGN(4); 18 *(.text) /* remaining code */ 19 *(.text.*) /* remaining code */ 20 *(.rodata) /* read-only data (constants) */ 21 *(.rodata*) 22 *(.glue_7) 23 *(.glue_7t) 24 *(.gnu.linkonce.t*) 25 26 /* section information for finsh shell */ 27 . = ALIGN(4); 28 __fsymtab_start = .; 29 KEEP(*(FSymTab)) 30 __fsymtab_end = .; 31 . = ALIGN(4); 32 __vsymtab_start = .; 33 KEEP(*(VSymTab)) 34 __vsymtab_end = .; 35 . = ALIGN(4); 36 37 /* section information for initial. */ 38 . = ALIGN(4); 39 __rt_init_start = .; 40 KEEP(*(SORT(.rti_fn*))) 41 __rt_init_end = .; 42 . = ALIGN(4); 43 44 . = ALIGN(4); 45 _etext = .; 46 } > CODE = 0 47 48 /* .ARM.exidx is sorted, so has to go in its own output section. */ 49 __exidx_start = .; 50 .ARM.exidx : 51 { 52 *(.ARM.exidx* .gnu.linkonce.armexidx.*) 53 54 /* This is used by the startup in order to initialize the .data secion */ 55 _sidata = .; 56 } > CODE 57 __exidx_end = .; 58 59 /* .data section which is used for initialized data */ 60 61 .data : AT (_sidata) 62 { 63 . = ALIGN(4); 64 /* This is used by the startup in order to initialize the .data secion */ 65 _sdata = . ; 66 67 *(.data) 68 *(.data.*) 69 *(.gnu.linkonce.d*) 70 71 . = ALIGN(4); 72 /* This is used by the startup in order to initialize the .data secion */ 73 _edata = . ; 74 } >DATA 75 76 .stack : 77 { 78 . = . + _system_stack_size; 79 . = ALIGN(4); 80 _estack = .; 81 } >DATA 82 83 __bss_start = .; 84 .bss : 85 { 86 . = ALIGN(4); 87 /* This is used by the startup in order to initialize the .bss secion */ 88 _sbss = .; 89 90 *(.bss) 91 *(.bss.*) 92 *(COMMON) 93 94 . = ALIGN(4); 95 /* This is used by the startup in order to initialize the .bss secion */ 96 _ebss = . ; 97 98 *(.bss.init) 99 } > DATA 100 __bss_end = .; 101 102 _end = .; 103 104 /* Stabs debugging sections. */ 105 .stab 0 : { *(.stab) } 106 .stabstr 0 : { *(.stabstr) } 107 .stab.excl 0 : { *(.stab.excl) } 108 .stab.exclstr 0 : { *(.stab.exclstr) } 109 .stab.index 0 : { *(.stab.index) } 110 .stab.indexstr 0 : { *(.stab.indexstr) } 111 .comment 0 : { *(.comment) } 112 /* DWARF debug sections. 113 * Symbols in the DWARF debugging sections are relative to the beginning 114 * of the section so we begin them at 0. */ 115 /* DWARF 1 */ 116 .debug 0 : { *(.debug) } 117 .line 0 : { *(.line) } 118 /* GNU DWARF 1 extensions */ 119 .debug_srcinfo 0 : { *(.debug_srcinfo) } 120 .debug_sfnames 0 : { *(.debug_sfnames) } 121 /* DWARF 1.1 and DWARF 2 */ 122 .debug_aranges 0 : { *(.debug_aranges) } 123 .debug_pubnames 0 : { *(.debug_pubnames) } 124 /* DWARF 2 */ 125 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } 126 .debug_abbrev 0 : { *(.debug_abbrev) } 127 .debug_line 0 : { *(.debug_line) } 128 .debug_frame 0 : { *(.debug_frame) } 129 .debug_str 0 : { *(.debug_str) } 130 .debug_loc 0 : { *(.debug_loc) } 131 .debug_macinfo 0 : { *(.debug_macinfo) } 132 /* SGI/MIPS DWARF 2 extensions */ 133 .debug_weaknames 0 : { *(.debug_weaknames) } 134 .debug_funcnames 0 : { *(.debug_funcnames) } 135 .debug_typenames 0 : { *(.debug_typenames) } 136 .debug_varnames 0 : { *(.debug_varnames) } 137} 138