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