]> git.sur5r.net Git - freertos/blob - Demo/AVR32_UC3A_GCC/Atmel_SW_Framework/UTILS/LINKER_SCRIPTS/AT32UC3A/1128/GCC/link_uc3a1128.lds
Temporarily revert the AVR32 port back to the V6.0.5 files. Work will continue on...
[freertos] / Demo / AVR32_UC3A_GCC / Atmel_SW_Framework / UTILS / LINKER_SCRIPTS / AT32UC3A / 1128 / GCC / link_uc3a1128.lds
1 /******************************************************************************
2  * AVR32 AT32UC3A1128 GNU LD script file.
3  *
4  * - Compiler:           GNU GCC for AVR32
5  * - Supported devices:  AVR32 AT32UC3A1128
6  *
7  * - author              Atmel Corporation: http://www.atmel.com \n
8  *                       Support and FAQ: http://support.atmel.no/
9  *
10  ******************************************************************************/
11
12 /* Copyright (c) 2009 Atmel Corporation. All rights reserved.
13  *
14  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following conditions are met:
16  *
17  * 1. Redistributions of source code must retain the above copyright notice, this
18  * list of conditions and the following disclaimer.
19  *
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.
23  *
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.
26  *
27  * 4. This software may only be redistributed and used in connection with an Atmel
28  * AVR product.
29  *
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
40  *
41  */
42
43 OUTPUT_FORMAT("elf32-avr32", "elf32-avr32", "elf32-avr32")
44
45 OUTPUT_ARCH(avr32:uc)
46
47 ENTRY(_start)
48
49 MEMORY
50 {
51   FLASH (rxai!w) : ORIGIN = 0x80000000, LENGTH = 0x00020000
52   INTRAM (wxa!ri) : ORIGIN = 0x00000004, LENGTH = 0x00007FFC
53   USERPAGE : ORIGIN = 0x80800000, LENGTH = 0x00000200
54 }
55
56 PHDRS
57 {
58   FLASH PT_LOAD;
59   INTRAM_ALIGN PT_NULL;
60   INTRAM_AT_FLASH PT_LOAD;
61   INTRAM PT_NULL;
62   USERPAGE PT_LOAD;
63 }
64
65 SECTIONS
66 {
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;
70
71   /* Use a default heap size if heap size was not defined. */
72   __heap_size__ = DEFINED(__heap_size__) ? __heap_size__ : __max_heap_size__;
73
74   /* Use a default stack size if stack size was not defined. */
75   __stack_size__ = DEFINED(__stack_size__) ? __stack_size__ : 4K;
76
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
113   .init           :
114   {
115     KEEP (*(.init))
116   } >FLASH AT>FLASH :FLASH =0xd703d703
117   .plt            : { *(.plt) } >FLASH AT>FLASH :FLASH
118   .text           :
119   {
120     *(.text .stub .text.* .gnu.linkonce.t.*)
121     KEEP (*(.text.*personality*))
122     /* .gnu.warning sections are handled specially by elf32.em.  */
123     *(.gnu.warning)
124   } >FLASH AT>FLASH :FLASH =0xd703d703
125   .fini           :
126   {
127     KEEP (*(.fini))
128   } >FLASH AT>FLASH :FLASH =0xd703d703
129   PROVIDE (__etext = .);
130   PROVIDE (_etext = .);
131   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
138   . = ORIGIN(INTRAM);
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 = .);
159   .ctors          :
160   {
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
169        is in.  */
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.*)))
177     KEEP (*(.ctors))
178   } >INTRAM AT>FLASH :INTRAM_AT_FLASH
179   .dtors          :
180   {
181     KEEP (*crtbegin*.o(.dtors))
182     KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
183     KEEP (*(SORT(.dtors.*)))
184     KEEP (*(.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
192   .data           :
193   {
194     *(.data .data.* .gnu.linkonce.d.*)
195     KEEP (*(.gnu.linkonce.d.*personality*))
196     SORT(CONSTRUCTORS)
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
200   PROVIDE (edata = .);
201   __bss_start = .;
202   .bss            :
203   {
204     *(.dynbss)
205     *(.bss .bss.* .gnu.linkonce.b.*)
206     *(COMMON)
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.  */
210     . = ALIGN(8);
211   } >INTRAM AT>INTRAM :INTRAM
212   . = ALIGN(8);
213   _end = .;
214   PROVIDE (end = .);
215   __heap_start__ = ALIGN(8);
216   .heap           :
217   {
218     *(.heap)
219     . = (__heap_size__ == __max_heap_size__) ?
220         ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ - ABSOLUTE(.) :
221         __heap_size__;
222   } >INTRAM AT>INTRAM :INTRAM
223   __heap_end__ = .;
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.  */
235   /* DWARF 1 */
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) }
244   /* DWARF 2 */
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__ :
258   {
259     _stack = .;
260     *(.stack)
261     . = __stack_size__;
262     _estack = .;
263   } >INTRAM AT>INTRAM :INTRAM
264   .userpage       : { *(.userpage .userpage.*) } >USERPAGE AT>USERPAGE :USERPAGE
265   /DISCARD/ : { *(.note.GNU-stack) }
266 }