* testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
[deliverable/binutils-gdb.git] / ld / scripttempl / avr.sc
CommitLineData
7c8bf1e8
MM
1cat <<EOF
2OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}")
3OUTPUT_ARCH(${ARCH})
4
5MEMORY
6{
7 text (rx) : ORIGIN = 0, LENGTH = $TEXT_LENGTH
84f1b567 8 data (rw!x) : ORIGIN = $DATA_ORIGIN, LENGTH = $DATA_LENGTH
7c8bf1e8
MM
9 eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = 64K
10}
11
12SECTIONS
13{
14 /* Read-only sections, merged into text segment: */
15 ${TEXT_DYNAMIC+${DYNAMIC}}
df381c72
AM
16 .hash : { *(.hash) }
17 .dynsym : { *(.dynsym) }
18 .dynstr : { *(.dynstr) }
19 .gnu.version : { *(.gnu.version) }
20 .gnu.version_d : { *(.gnu.version_d) }
21 .gnu.version_r : { *(.gnu.version_r) }
22
23 .rel.init : { *(.rel.init) }
24 .rela.init : { *(.rela.init) }
25 .rel.text :
7c8bf1e8
MM
26 {
27 *(.rel.text)
28 ${RELOCATING+*(.rel.text.*)}
29 ${RELOCATING+*(.rel.gnu.linkonce.t*)}
30 }
df381c72 31 .rela.text :
7c8bf1e8
MM
32 {
33 *(.rela.text)
34 ${RELOCATING+*(.rela.text.*)}
35 ${RELOCATING+*(.rela.gnu.linkonce.t*)}
36 }
df381c72
AM
37 .rel.fini : { *(.rel.fini) }
38 .rela.fini : { *(.rela.fini) }
39 .rel.rodata :
7c8bf1e8
MM
40 {
41 *(.rel.rodata)
42 ${RELOCATING+*(.rel.rodata.*)}
43 ${RELOCATING+*(.rel.gnu.linkonce.r*)}
44 }
df381c72 45 .rela.rodata :
7c8bf1e8
MM
46 {
47 *(.rela.rodata)
48 ${RELOCATING+*(.rela.rodata.*)}
49 ${RELOCATING+*(.rela.gnu.linkonce.r*)}
50 }
df381c72 51 .rel.data :
7c8bf1e8
MM
52 {
53 *(.rel.data)
54 ${RELOCATING+*(.rel.data.*)}
55 ${RELOCATING+*(.rel.gnu.linkonce.d*)}
56 }
df381c72 57 .rela.data :
7c8bf1e8
MM
58 {
59 *(.rela.data)
60 ${RELOCATING+*(.rela.data.*)}
61 ${RELOCATING+*(.rela.gnu.linkonce.d*)}
62 }
df381c72
AM
63 .rel.ctors : { *(.rel.ctors) }
64 .rela.ctors : { *(.rela.ctors) }
65 .rel.dtors : { *(.rel.dtors) }
66 .rela.dtors : { *(.rela.dtors) }
67 .rel.got : { *(.rel.got) }
68 .rela.got : { *(.rela.got) }
69 .rel.bss : { *(.rel.bss) }
70 .rela.bss : { *(.rela.bss) }
71 .rel.plt : { *(.rel.plt) }
72 .rela.plt : { *(.rela.plt) }
7c8bf1e8 73
28c9d252 74 /* Internal text space or external memory. */
df381c72 75 .text :
7c8bf1e8 76 {
0c9b4fee 77 *(.vectors)
df406460 78 KEEP(*(.vectors))
0c9b4fee 79
28c9d252
NC
80 /* For data that needs to reside in the lower 64k of progmem. */
81 *(.progmem.gcc*)
82 *(.progmem*)
83 ${RELOCATING+. = ALIGN(2);}
84
85 ${CONSTRUCTING+ __trampolines_start = . ; }
86 /* The jump trampolines for the 16-bit limited relocs will reside here. */
87 *(.trampolines)
88 *(.trampolines*)
89 ${CONSTRUCTING+ __trampolines_end = . ; }
90
91 /* For future tablejump instruction arrays for 3 byte pc devices.
92 We don't relax jump/call instructions within these sections. */
93 *(.jumptables)
94 *(.jumptables*)
95
96 /* For code that needs to reside in the lower 128k progmem. */
97 *(.lowtext)
98 *(.lowtext*)
99
0c9b4fee
MM
100 ${CONSTRUCTING+ __ctors_start = . ; }
101 ${CONSTRUCTING+ *(.ctors) }
102 ${CONSTRUCTING+ __ctors_end = . ; }
103 ${CONSTRUCTING+ __dtors_start = . ; }
104 ${CONSTRUCTING+ *(.dtors) }
105 ${CONSTRUCTING+ __dtors_end = . ; }
df406460
NC
106 KEEP(SORT(*)(.ctors))
107 KEEP(SORT(*)(.dtors))
0c9b4fee 108
28c9d252
NC
109 /* From this point on, we don't bother about wether the insns are
110 below or above the 16 bits boundary. */
0c9b4fee 111 *(.init0) /* Start here after reset. */
df406460 112 KEEP (*(.init0))
0c9b4fee 113 *(.init1)
df406460 114 KEEP (*(.init1))
0c9b4fee 115 *(.init2) /* Clear __zero_reg__, set up stack pointer. */
df406460 116 KEEP (*(.init2))
0c9b4fee 117 *(.init3)
df406460 118 KEEP (*(.init3))
0c9b4fee 119 *(.init4) /* Initialize data and BSS. */
df406460 120 KEEP (*(.init4))
0c9b4fee 121 *(.init5)
df406460 122 KEEP (*(.init5))
0c9b4fee 123 *(.init6) /* C++ constructors. */
df406460 124 KEEP (*(.init6))
0c9b4fee 125 *(.init7)
df406460 126 KEEP (*(.init7))
0c9b4fee 127 *(.init8)
df406460 128 KEEP (*(.init8))
0c9b4fee 129 *(.init9) /* Call main(). */
df406460 130 KEEP (*(.init9))
7c8bf1e8
MM
131 *(.text)
132 ${RELOCATING+. = ALIGN(2);}
133 *(.text.*)
134 ${RELOCATING+. = ALIGN(2);}
0c9b4fee 135 *(.fini9) /* _exit() starts here. */
df406460 136 KEEP (*(.fini9))
0c9b4fee 137 *(.fini8)
df406460 138 KEEP (*(.fini8))
0c9b4fee 139 *(.fini7)
df406460 140 KEEP (*(.fini7))
0c9b4fee 141 *(.fini6) /* C++ destructors. */
df406460 142 KEEP (*(.fini6))
0c9b4fee 143 *(.fini5)
df406460 144 KEEP (*(.fini5))
0c9b4fee 145 *(.fini4)
df406460 146 KEEP (*(.fini4))
0c9b4fee 147 *(.fini3)
df406460 148 KEEP (*(.fini3))
0c9b4fee 149 *(.fini2)
df406460 150 KEEP (*(.fini2))
0c9b4fee 151 *(.fini1)
df406460 152 KEEP (*(.fini1))
0c9b4fee 153 *(.fini0) /* Infinite loop after program termination. */
df406460 154 KEEP (*(.fini0))
7c8bf1e8
MM
155 ${RELOCATING+ _etext = . ; }
156 } ${RELOCATING+ > text}
157
df381c72 158 .data : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text))}
7c8bf1e8
MM
159 {
160 ${RELOCATING+ PROVIDE (__data_start = .) ; }
161 *(.data)
df406460
NC
162 *(.data*)
163 *(.rodata) /* We need to include .rodata here if gcc is used */
164 *(.rodata*) /* with -fdata-sections. */
7c8bf1e8
MM
165 *(.gnu.linkonce.d*)
166 ${RELOCATING+. = ALIGN(2);}
167 ${RELOCATING+ _edata = . ; }
0c9b4fee 168 ${RELOCATING+ PROVIDE (__data_end = .) ; }
7c8bf1e8
MM
169 } ${RELOCATING+ > data}
170
df381c72 171 .bss :${RELOCATING+ AT (ADDR (.bss))}
7c8bf1e8
MM
172 {
173 ${RELOCATING+ PROVIDE (__bss_start = .) ; }
174 *(.bss)
df406460 175 *(.bss*)
7c8bf1e8
MM
176 *(COMMON)
177 ${RELOCATING+ PROVIDE (__bss_end = .) ; }
0c9b4fee
MM
178 } ${RELOCATING+ > data}
179
180 ${RELOCATING+ __data_load_start = LOADADDR(.data); }
181 ${RELOCATING+ __data_load_end = __data_load_start + SIZEOF(.data); }
182
183 /* Global data not cleared after reset. */
df381c72 184 .noinit :
0c9b4fee
MM
185 {
186 ${RELOCATING+ PROVIDE (__noinit_start = .) ; }
187 *(.noinit*)
188 ${RELOCATING+ PROVIDE (__noinit_end = .) ; }
7c8bf1e8 189 ${RELOCATING+ _end = . ; }
0c9b4fee 190 ${RELOCATING+ PROVIDE (__heap_start = .) ; }
7c8bf1e8
MM
191 } ${RELOCATING+ > data}
192
df381c72 193 .eeprom :
7c8bf1e8
MM
194 {
195 *(.eeprom*)
196 ${RELOCATING+ __eeprom_end = . ; }
197 } ${RELOCATING+ > eeprom}
198
199 /* Stabs debugging sections. */
200 .stab 0 : { *(.stab) }
201 .stabstr 0 : { *(.stabstr) }
202 .stab.excl 0 : { *(.stab.excl) }
203 .stab.exclstr 0 : { *(.stab.exclstr) }
204 .stab.index 0 : { *(.stab.index) }
205 .stab.indexstr 0 : { *(.stab.indexstr) }
206 .comment 0 : { *(.comment) }
207
208 /* DWARF debug sections.
209 Symbols in the DWARF debugging sections are relative to the beginning
210 of the section so we begin them at 0. */
211
212 /* DWARF 1 */
213 .debug 0 : { *(.debug) }
214 .line 0 : { *(.line) }
215
216 /* GNU DWARF 1 extensions */
217 .debug_srcinfo 0 : { *(.debug_srcinfo) }
218 .debug_sfnames 0 : { *(.debug_sfnames) }
219
220 /* DWARF 1.1 and DWARF 2 */
221 .debug_aranges 0 : { *(.debug_aranges) }
222 .debug_pubnames 0 : { *(.debug_pubnames) }
223
224 /* DWARF 2 */
225 .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
226 .debug_abbrev 0 : { *(.debug_abbrev) }
227 .debug_line 0 : { *(.debug_line) }
228 .debug_frame 0 : { *(.debug_frame) }
229 .debug_str 0 : { *(.debug_str) }
230 .debug_loc 0 : { *(.debug_loc) }
231 .debug_macinfo 0 : { *(.debug_macinfo) }
232}
233EOF
234
This page took 0.314403 seconds and 4 git commands to generate.