1cat <<EOF 2OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}") 3OUTPUT_ARCH(${ARCH}) 4 5MEMORY 6{ 7 text (rx) : ORIGIN = 0, LENGTH = $TEXT_LENGTH 8 data (rw!x) : ORIGIN = 0x800060, LENGTH = $DATA_LENGTH 9 eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = 64K 10} 11 12SECTIONS 13{ 14 /* Read-only sections, merged into text segment: */ 15 ${TEXT_DYNAMIC+${DYNAMIC}} 16 .hash ${RELOCATING-0} : { *(.hash) } 17 .dynsym ${RELOCATING-0} : { *(.dynsym) } 18 .dynstr ${RELOCATING-0} : { *(.dynstr) } 19 .gnu.version ${RELOCATING-0} : { *(.gnu.version) } 20 .gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) } 21 .gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) } 22 23 .rel.init ${RELOCATING-0} : { *(.rel.init) } 24 .rela.init ${RELOCATING-0} : { *(.rela.init) } 25 .rel.text ${RELOCATING-0} : 26 { 27 *(.rel.text) 28 ${RELOCATING+*(.rel.text.*)} 29 ${RELOCATING+*(.rel.gnu.linkonce.t*)} 30 } 31 .rela.text ${RELOCATING-0} : 32 { 33 *(.rela.text) 34 ${RELOCATING+*(.rela.text.*)} 35 ${RELOCATING+*(.rela.gnu.linkonce.t*)} 36 } 37 .rel.fini ${RELOCATING-0} : { *(.rel.fini) } 38 .rela.fini ${RELOCATING-0} : { *(.rela.fini) } 39 .rel.rodata ${RELOCATING-0} : 40 { 41 *(.rel.rodata) 42 ${RELOCATING+*(.rel.rodata.*)} 43 ${RELOCATING+*(.rel.gnu.linkonce.r*)} 44 } 45 .rela.rodata ${RELOCATING-0} : 46 { 47 *(.rela.rodata) 48 ${RELOCATING+*(.rela.rodata.*)} 49 ${RELOCATING+*(.rela.gnu.linkonce.r*)} 50 } 51 .rel.data ${RELOCATING-0} : 52 { 53 *(.rel.data) 54 ${RELOCATING+*(.rel.data.*)} 55 ${RELOCATING+*(.rel.gnu.linkonce.d*)} 56 } 57 .rela.data ${RELOCATING-0} : 58 { 59 *(.rela.data) 60 ${RELOCATING+*(.rela.data.*)} 61 ${RELOCATING+*(.rela.gnu.linkonce.d*)} 62 } 63 .rel.ctors ${RELOCATING-0} : { *(.rel.ctors) } 64 .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) } 65 .rel.dtors ${RELOCATING-0} : { *(.rel.dtors) } 66 .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) } 67 .rel.got ${RELOCATING-0} : { *(.rel.got) } 68 .rela.got ${RELOCATING-0} : { *(.rela.got) } 69 .rel.bss ${RELOCATING-0} : { *(.rel.bss) } 70 .rela.bss ${RELOCATING-0} : { *(.rela.bss) } 71 .rel.plt ${RELOCATING-0} : { *(.rel.plt) } 72 .rela.plt ${RELOCATING-0} : { *(.rela.plt) } 73 74 /* Internal text space or external memory */ 75 .text : 76 { 77 *(.vectors) 78 79 ${CONSTRUCTING+ __ctors_start = . ; } 80 ${CONSTRUCTING+ *(.ctors) } 81 ${CONSTRUCTING+ __ctors_end = . ; } 82 ${CONSTRUCTING+ __dtors_start = . ; } 83 ${CONSTRUCTING+ *(.dtors) } 84 ${CONSTRUCTING+ __dtors_end = . ; } 85 86 *(.progmem.gcc*) 87 *(.progmem*) 88 ${RELOCATING+. = ALIGN(2);} 89 *(.init0) /* Start here after reset. */ 90 *(.init1) 91 *(.init2) /* Clear __zero_reg__, set up stack pointer. */ 92 *(.init3) 93 *(.init4) /* Initialize data and BSS. */ 94 *(.init5) 95 *(.init6) /* C++ constructors. */ 96 *(.init7) 97 *(.init8) 98 *(.init9) /* Call main(). */ 99 *(.text) 100 ${RELOCATING+. = ALIGN(2);} 101 *(.text.*) 102 ${RELOCATING+. = ALIGN(2);} 103 *(.fini9) /* _exit() starts here. */ 104 *(.fini8) 105 *(.fini7) 106 *(.fini6) /* C++ destructors. */ 107 *(.fini5) 108 *(.fini4) 109 *(.fini3) 110 *(.fini2) 111 *(.fini1) 112 *(.fini0) /* Infinite loop after program termination. */ 113 ${RELOCATING+ _etext = . ; } 114 } ${RELOCATING+ > text} 115 116 .data ${RELOCATING-0} : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text))} 117 { 118 ${RELOCATING+ PROVIDE (__data_start = .) ; } 119 *(.data) 120 *(.gnu.linkonce.d*) 121 ${RELOCATING+. = ALIGN(2);} 122 ${RELOCATING+ _edata = . ; } 123 ${RELOCATING+ PROVIDE (__data_end = .) ; } 124 } ${RELOCATING+ > data} 125 126 .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} : 127 { 128 ${RELOCATING+ PROVIDE (__bss_start = .) ; } 129 *(.bss) 130 *(COMMON) 131 ${RELOCATING+ PROVIDE (__bss_end = .) ; } 132 } ${RELOCATING+ > data} 133 134 ${RELOCATING+ __data_load_start = LOADADDR(.data); } 135 ${RELOCATING+ __data_load_end = __data_load_start + SIZEOF(.data); } 136 137 /* Global data not cleared after reset. */ 138 .noinit ${RELOCATING+ SIZEOF(.bss) + ADDR(.bss)} : 139 { 140 ${RELOCATING+ PROVIDE (__noinit_start = .) ; } 141 *(.noinit*) 142 ${RELOCATING+ PROVIDE (__noinit_end = .) ; } 143 ${RELOCATING+ _end = . ; } 144 ${RELOCATING+ PROVIDE (__heap_start = .) ; } 145 } ${RELOCATING+ > data} 146 147 .eeprom ${RELOCATING-0}: 148 ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text) + SIZEOF (.data))} 149 { 150 *(.eeprom*) 151 ${RELOCATING+ __eeprom_end = . ; } 152 } ${RELOCATING+ > eeprom} 153 154 /* Stabs debugging sections. */ 155 .stab 0 : { *(.stab) } 156 .stabstr 0 : { *(.stabstr) } 157 .stab.excl 0 : { *(.stab.excl) } 158 .stab.exclstr 0 : { *(.stab.exclstr) } 159 .stab.index 0 : { *(.stab.index) } 160 .stab.indexstr 0 : { *(.stab.indexstr) } 161 .comment 0 : { *(.comment) } 162 163 /* DWARF debug sections. 164 Symbols in the DWARF debugging sections are relative to the beginning 165 of the section so we begin them at 0. */ 166 167 /* DWARF 1 */ 168 .debug 0 : { *(.debug) } 169 .line 0 : { *(.line) } 170 171 /* GNU DWARF 1 extensions */ 172 .debug_srcinfo 0 : { *(.debug_srcinfo) } 173 .debug_sfnames 0 : { *(.debug_sfnames) } 174 175 /* DWARF 1.1 and DWARF 2 */ 176 .debug_aranges 0 : { *(.debug_aranges) } 177 .debug_pubnames 0 : { *(.debug_pubnames) } 178 179 /* DWARF 2 */ 180 .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) } 181 .debug_abbrev 0 : { *(.debug_abbrev) } 182 .debug_line 0 : { *(.debug_line) } 183 .debug_frame 0 : { *(.debug_frame) } 184 .debug_str 0 : { *(.debug_str) } 185 .debug_loc 0 : { *(.debug_loc) } 186 .debug_macinfo 0 : { *(.debug_macinfo) } 187} 188EOF 189 190