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