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