1 /******************************************************************************
2 * AVR32 AT32UC3A1512 GNU LD script file.
4 * - Compiler: GNU GCC for AVR32
5 * - Supported devices: AVR32 AT32UC3A1512
7 * - author Atmel Corporation: http://www.atmel.com \n
8 * Support and FAQ: http://support.atmel.no/
10 ******************************************************************************/
12 /* Copyright (c) 2009 Atmel Corporation. All rights reserved.
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions are met:
17 * 1. Redistributions of source code must retain the above copyright notice, this
18 * list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright notice,
21 * this list of conditions and the following disclaimer in the documentation
22 * and/or other materials provided with the distribution.
24 * 3. The name of Atmel may not be used to endorse or promote products derived
25 * from this software without specific prior written permission.
27 * 4. This software may only be redistributed and used in connection with an Atmel
30 * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
31 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
32 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
33 * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
34 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
35 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
36 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
37 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
39 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
43 OUTPUT_FORMAT("elf32-avr32", "elf32-avr32", "elf32-avr32")
51 FLASH (rxai!w) : ORIGIN = 0x80000000, LENGTH = 0x00080000
52 INTRAM (wxa!ri) : ORIGIN = 0x00000004, LENGTH = 0x0000FFFC
53 USERPAGE : ORIGIN = 0x80800000, LENGTH = 0x00000200
60 INTRAM_AT_FLASH PT_LOAD;
67 /* If this heap size is selected, all the INTRAM space from the end of the
68 data area to the beginning of the stack will be allocated for the heap. */
69 __max_heap_size__ = -1;
71 /* Use a default heap size if heap size was not defined. */
72 __heap_size__ = DEFINED(__heap_size__) ? __heap_size__ : __max_heap_size__;
74 /* Use a default stack size if stack size was not defined. */
75 __stack_size__ = DEFINED(__stack_size__) ? __stack_size__ : 4K;
77 /* Read-only sections, merged into text segment: */
78 PROVIDE (__executable_start = 0x80000000); . = 0x80000000;
79 .interp : { *(.interp) } >FLASH AT>FLASH :FLASH
80 .reset : { *(.reset) } >FLASH AT>FLASH :FLASH
81 .hash : { *(.hash) } >FLASH AT>FLASH :FLASH
82 .dynsym : { *(.dynsym) } >FLASH AT>FLASH :FLASH
83 .dynstr : { *(.dynstr) } >FLASH AT>FLASH :FLASH
84 .gnu.version : { *(.gnu.version) } >FLASH AT>FLASH :FLASH
85 .gnu.version_d : { *(.gnu.version_d) } >FLASH AT>FLASH :FLASH
86 .gnu.version_r : { *(.gnu.version_r) } >FLASH AT>FLASH :FLASH
87 .rel.init : { *(.rel.init) } >FLASH AT>FLASH :FLASH
88 .rela.init : { *(.rela.init) } >FLASH AT>FLASH :FLASH
89 .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
90 .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
91 .rel.fini : { *(.rel.fini) } >FLASH AT>FLASH :FLASH
92 .rela.fini : { *(.rela.fini) } >FLASH AT>FLASH :FLASH
93 .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
94 .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
95 .rel.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
96 .rela.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
97 .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
98 .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
99 .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
100 .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
101 .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
102 .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
103 .rel.ctors : { *(.rel.ctors) } >FLASH AT>FLASH :FLASH
104 .rela.ctors : { *(.rela.ctors) } >FLASH AT>FLASH :FLASH
105 .rel.dtors : { *(.rel.dtors) } >FLASH AT>FLASH :FLASH
106 .rela.dtors : { *(.rela.dtors) } >FLASH AT>FLASH :FLASH
107 .rel.got : { *(.rel.got) } >FLASH AT>FLASH :FLASH
108 .rela.got : { *(.rela.got) } >FLASH AT>FLASH :FLASH
109 .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
110 .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
111 .rel.plt : { *(.rel.plt) } >FLASH AT>FLASH :FLASH
112 .rela.plt : { *(.rela.plt) } >FLASH AT>FLASH :FLASH
116 } >FLASH AT>FLASH :FLASH =0xd703d703
117 .plt : { *(.plt) } >FLASH AT>FLASH :FLASH
120 *(.text .stub .text.* .gnu.linkonce.t.*)
121 KEEP (*(.text.*personality*))
122 /* .gnu.warning sections are handled specially by elf32.em. */
124 } >FLASH AT>FLASH :FLASH =0xd703d703
128 } >FLASH AT>FLASH :FLASH =0xd703d703
129 PROVIDE (__etext = .);
130 PROVIDE (_etext = .);
132 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
133 .rodata1 : { *(.rodata1) } >FLASH AT>FLASH :FLASH
134 .eh_frame_hdr : { *(.eh_frame_hdr) } >FLASH AT>FLASH :FLASH
135 .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } >FLASH AT>FLASH :FLASH
136 .gcc_except_table : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >FLASH AT>FLASH :FLASH
137 .lalign : { . = ALIGN(8); PROVIDE(_data_lma = .); } >FLASH AT>FLASH :FLASH
139 .dalign : { . = ALIGN(8); PROVIDE(_data = .); } >INTRAM AT>INTRAM :INTRAM_ALIGN
140 /* Exception handling */
141 .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
142 .gcc_except_table : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
143 /* Thread Local Storage sections */
144 .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
145 .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
146 /* Ensure the __preinit_array_start label is properly aligned. We
147 could instead move the label definition inside the section, but
148 the linker would then create the section even if it turns out to
149 be empty, which isn't pretty. */
150 PROVIDE (__preinit_array_start = ALIGN(32 / 8));
151 .preinit_array : { KEEP (*(.preinit_array)) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
152 PROVIDE (__preinit_array_end = .);
153 PROVIDE (__init_array_start = .);
154 .init_array : { KEEP (*(.init_array)) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
155 PROVIDE (__init_array_end = .);
156 PROVIDE (__fini_array_start = .);
157 .fini_array : { KEEP (*(.fini_array)) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
158 PROVIDE (__fini_array_end = .);
161 /* gcc uses crtbegin.o to find the start of
162 the constructors, so we make sure it is
163 first. Because this is a wildcard, it
164 doesn't matter if the user does not
165 actually link against crtbegin.o; the
166 linker won't look for a file to match a
167 wildcard. The wildcard also means that it
168 doesn't matter which directory crtbegin.o
170 KEEP (*crtbegin*.o(.ctors))
171 /* We don't want to include the .ctor section from
172 from the crtend.o file until after the sorted ctors.
173 The .ctor section from the crtend file contains the
174 end of ctors marker and it must be last */
175 KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
176 KEEP (*(SORT(.ctors.*)))
178 } >INTRAM AT>FLASH :INTRAM_AT_FLASH
181 KEEP (*crtbegin*.o(.dtors))
182 KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
183 KEEP (*(SORT(.dtors.*)))
185 } >INTRAM AT>FLASH :INTRAM_AT_FLASH
186 .jcr : { KEEP (*(.jcr)) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
187 .data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
188 .dynamic : { *(.dynamic) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
189 .got : { *(.got.plt) *(.got) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
190 .ramtext : { *(.ramtext .ramtext.*) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
191 .ddalign : { . = ALIGN(8); } >INTRAM AT>FLASH :INTRAM_AT_FLASH
194 *(.data .data.* .gnu.linkonce.d.*)
195 KEEP (*(.gnu.linkonce.d.*personality*))
197 } >INTRAM AT>FLASH :INTRAM_AT_FLASH
198 .data1 : { *(.data1) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
199 .balign : { . = ALIGN(8); PROVIDE(_edata = .); } >INTRAM AT>FLASH :INTRAM_AT_FLASH
205 *(.bss .bss.* .gnu.linkonce.b.*)
207 /* Align here to ensure that the .bss section occupies space up to
208 _end. Align after .bss to ensure correct alignment even if the
209 .bss section disappears because there are no input sections. */
211 } >INTRAM AT>INTRAM :INTRAM
215 __heap_start__ = ALIGN(8);
219 . = (__heap_size__ == __max_heap_size__) ?
220 ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ - ABSOLUTE(.) :
222 } >INTRAM AT>INTRAM :INTRAM
224 /* Stabs debugging sections. */
225 .stab 0 : { *(.stab) }
226 .stabstr 0 : { *(.stabstr) }
227 .stab.excl 0 : { *(.stab.excl) }
228 .stab.exclstr 0 : { *(.stab.exclstr) }
229 .stab.index 0 : { *(.stab.index) }
230 .stab.indexstr 0 : { *(.stab.indexstr) }
231 .comment 0 : { *(.comment) }
232 /* DWARF debug sections.
233 Symbols in the DWARF debugging sections are relative to the beginning
234 of the section so we begin them at 0. */
236 .debug 0 : { *(.debug) }
237 .line 0 : { *(.line) }
238 /* GNU DWARF 1 extensions */
239 .debug_srcinfo 0 : { *(.debug_srcinfo) }
240 .debug_sfnames 0 : { *(.debug_sfnames) }
241 /* DWARF 1.1 and DWARF 2 */
242 .debug_aranges 0 : { *(.debug_aranges) }
243 .debug_pubnames 0 : { *(.debug_pubnames) }
245 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
246 .debug_abbrev 0 : { *(.debug_abbrev) }
247 .debug_line 0 : { *(.debug_line) }
248 .debug_frame 0 : { *(.debug_frame) }
249 .debug_str 0 : { *(.debug_str) }
250 .debug_loc 0 : { *(.debug_loc) }
251 .debug_macinfo 0 : { *(.debug_macinfo) }
252 /* SGI/MIPS DWARF 2 extensions */
253 .debug_weaknames 0 : { *(.debug_weaknames) }
254 .debug_funcnames 0 : { *(.debug_funcnames) }
255 .debug_typenames 0 : { *(.debug_typenames) }
256 .debug_varnames 0 : { *(.debug_varnames) }
257 .stack ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ :
263 } >INTRAM AT>INTRAM :INTRAM
264 .userpage : { *(.userpage .userpage.*) } >USERPAGE AT>USERPAGE :USERPAGE
265 /DISCARD/ : { *(.note.GNU-stack) }