]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/AVR32_UC3/UTILS/LINKER_SCRIPTS/AT32UC3B/1256/GCC/link_uc3b1256.lds
Add FreeRTOS-Plus directory.
[freertos] / FreeRTOS / Demo / AVR32_UC3 / UTILS / LINKER_SCRIPTS / AT32UC3B / 1256 / GCC / link_uc3b1256.lds
1 /******************************************************************************
2  * AVR32 AT32UC3B1256 GNU LD script file.
3  *
4  * - Compiler:           GNU GCC for AVR32
5  * - Supported devices:  AVR32 AT32UC3B1256
6  *
7  * - author              Atmel Corporation: http://www.atmel.com \n
8  *                       Support and FAQ: http://support.atmel.no/
9  *
10  ******************************************************************************/
11
12 /* Copyright (c) 2007, 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,
18  * this 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  * THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS OR IMPLIED
28  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
29  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND
30  * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT,
31  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
32  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
33  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
34  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
36  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37  */
38
39
40 OUTPUT_FORMAT("elf32-avr32", "elf32-avr32", "elf32-avr32")
41
42 OUTPUT_ARCH(avr32:uc)
43
44 ENTRY(_start)
45
46 MEMORY
47 {
48   FLASH (rxai!w) : ORIGIN = 0x80000000, LENGTH = 0x00040000
49   INTRAM (wxa!ri) : ORIGIN = 0x00000004, LENGTH = 0x00007FFC
50   USERPAGE : ORIGIN = 0x80800000, LENGTH = 0x00000200
51   FACTORYPAGE : ORIGIN = 0x80800200, LENGTH = 0x00000200
52 }
53
54 PHDRS
55 {
56   FLASH PT_LOAD;
57   INTRAM PT_NULL;
58   USERPAGE PT_LOAD;
59   FACTORYPAGE PT_LOAD;
60 }
61
62 SECTIONS
63 {
64   /* If this heap size is selected, all the INTRAM space from the end of the
65      data area to the beginning of the stack will be allocated for the heap. */
66   __max_heap_size__ = -1;
67
68   /* Use a default heap size if heap size was not defined. */
69   __heap_size__ = DEFINED(__heap_size__) ? __heap_size__ : __max_heap_size__;
70
71   /* Use a default stack size if stack size was not defined. */
72   __stack_size__ = DEFINED(__stack_size__) ? __stack_size__ : 4K;
73
74   /* Read-only sections, merged into text segment: */
75   PROVIDE (__executable_start = 0x80000000); . = 0x80000000;
76   .interp         : { *(.interp) } >FLASH AT>FLASH :FLASH
77   .reset : {  *(.reset) } >FLASH AT>FLASH :FLASH
78   .hash           : { *(.hash) } >FLASH AT>FLASH :FLASH
79   .dynsym         : { *(.dynsym) } >FLASH AT>FLASH :FLASH
80   .dynstr         : { *(.dynstr) } >FLASH AT>FLASH :FLASH
81   .gnu.version    : { *(.gnu.version) } >FLASH AT>FLASH :FLASH
82   .gnu.version_d  : { *(.gnu.version_d) } >FLASH AT>FLASH :FLASH
83   .gnu.version_r  : { *(.gnu.version_r) } >FLASH AT>FLASH :FLASH
84   .rel.init       : { *(.rel.init) } >FLASH AT>FLASH :FLASH
85   .rela.init      : { *(.rela.init) } >FLASH AT>FLASH :FLASH
86   .rel.text       : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
87   .rela.text      : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } >FLASH AT>FLASH :FLASH
88   .rel.fini       : { *(.rel.fini) } >FLASH AT>FLASH :FLASH
89   .rela.fini      : { *(.rela.fini) } >FLASH AT>FLASH :FLASH
90   .rel.rodata     : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
91   .rela.rodata    : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
92   .rel.data.rel.ro   : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
93   .rela.data.rel.ro   : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH :FLASH
94   .rel.data       : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
95   .rela.data      : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } >FLASH AT>FLASH :FLASH
96   .rel.tdata      : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
97   .rela.tdata     : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } >FLASH AT>FLASH :FLASH
98   .rel.tbss       : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
99   .rela.tbss      : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } >FLASH AT>FLASH :FLASH
100   .rel.ctors      : { *(.rel.ctors) } >FLASH AT>FLASH :FLASH
101   .rela.ctors     : { *(.rela.ctors) } >FLASH AT>FLASH :FLASH
102   .rel.dtors      : { *(.rel.dtors) } >FLASH AT>FLASH :FLASH
103   .rela.dtors     : { *(.rela.dtors) } >FLASH AT>FLASH :FLASH
104   .rel.got        : { *(.rel.got) } >FLASH AT>FLASH :FLASH
105   .rela.got       : { *(.rela.got) } >FLASH AT>FLASH :FLASH
106   .rel.bss        : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
107   .rela.bss       : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } >FLASH AT>FLASH :FLASH
108   .rel.plt        : { *(.rel.plt) } >FLASH AT>FLASH :FLASH
109   .rela.plt       : { *(.rela.plt) } >FLASH AT>FLASH :FLASH
110   .init           :
111   {
112     KEEP (*(.init))
113   } >FLASH AT>FLASH :FLASH =0xd703d703
114   .plt            : { *(.plt) } >FLASH AT>FLASH :FLASH
115   .text           :
116   {
117     *(.text .stub .text.* .gnu.linkonce.t.*)
118     KEEP (*(.text.*personality*))
119     /* .gnu.warning sections are handled specially by elf32.em.  */
120     *(.gnu.warning)
121   } >FLASH AT>FLASH :FLASH =0xd703d703
122   .fini           :
123   {
124     KEEP (*(.fini))
125   } >FLASH AT>FLASH :FLASH =0xd703d703
126   PROVIDE (__etext = .);
127   PROVIDE (_etext = .);
128   PROVIDE (etext = .);
129   .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) } >FLASH AT>FLASH :FLASH
130   .rodata1        : { *(.rodata1) } >FLASH AT>FLASH :FLASH
131   .eh_frame_hdr : { *(.eh_frame_hdr) } >FLASH AT>FLASH :FLASH
132   .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) } >FLASH AT>FLASH :FLASH
133   .gcc_except_table   : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >FLASH AT>FLASH :FLASH
134   .lalign       : { . = ALIGN(8); PROVIDE(_data_lma = .); } >FLASH AT>FLASH :FLASH
135   . = ORIGIN(INTRAM);
136   .dalign       : { . = ALIGN(8); PROVIDE(_data = .); } >INTRAM AT>INTRAM :INTRAM
137   /* Exception handling  */
138   .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) } >INTRAM AT>FLASH :FLASH
139   .gcc_except_table   : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >INTRAM AT>FLASH :FLASH
140   /* Thread Local Storage sections  */
141   .tdata          : { *(.tdata .tdata.* .gnu.linkonce.td.*) } >INTRAM AT>FLASH :FLASH
142   .tbss           : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } >INTRAM AT>FLASH :FLASH
143   /* Ensure the __preinit_array_start label is properly aligned.  We
144      could instead move the label definition inside the section, but
145      the linker would then create the section even if it turns out to
146      be empty, which isn't pretty.  */
147   PROVIDE (__preinit_array_start = ALIGN(32 / 8));
148   .preinit_array     : { KEEP (*(.preinit_array)) } >INTRAM AT>FLASH :FLASH
149   PROVIDE (__preinit_array_end = .);
150   PROVIDE (__init_array_start = .);
151   .init_array     : { KEEP (*(.init_array)) } >INTRAM AT>FLASH :FLASH
152   PROVIDE (__init_array_end = .);
153   PROVIDE (__fini_array_start = .);
154   .fini_array     : { KEEP (*(.fini_array)) } >INTRAM AT>FLASH :FLASH
155   PROVIDE (__fini_array_end = .);
156   .ctors          :
157   {
158     /* gcc uses crtbegin.o to find the start of
159        the constructors, so we make sure it is
160        first.  Because this is a wildcard, it
161        doesn't matter if the user does not
162        actually link against crtbegin.o; the
163        linker won't look for a file to match a
164        wildcard.  The wildcard also means that it
165        doesn't matter which directory crtbegin.o
166        is in.  */
167     KEEP (*crtbegin*.o(.ctors))
168     /* We don't want to include the .ctor section from
169        from the crtend.o file until after the sorted ctors.
170        The .ctor section from the crtend file contains the
171        end of ctors marker and it must be last */
172     KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
173     KEEP (*(SORT(.ctors.*)))
174     KEEP (*(.ctors))
175   } >INTRAM AT>FLASH :FLASH
176   .dtors          :
177   {
178     KEEP (*crtbegin*.o(.dtors))
179     KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
180     KEEP (*(SORT(.dtors.*)))
181     KEEP (*(.dtors))
182   } >INTRAM AT>FLASH :FLASH
183   .jcr            : { KEEP (*(.jcr)) } >INTRAM AT>FLASH :FLASH
184   .data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) } >INTRAM AT>FLASH :FLASH
185   .dynamic        : { *(.dynamic) } >INTRAM AT>FLASH :FLASH
186   .got            : { *(.got.plt) *(.got) } >INTRAM AT>FLASH :FLASH
187   .data           :
188   {
189     *(.data .data.* .gnu.linkonce.d.*)
190     KEEP (*(.gnu.linkonce.d.*personality*))
191     SORT(CONSTRUCTORS)
192   } >INTRAM AT>FLASH :FLASH
193   .data1          : { *(.data1) } >INTRAM AT>FLASH :FLASH
194   .balign       : { . = ALIGN(8); _edata = .; } >INTRAM AT>FLASH :FLASH
195   _edata = .;
196   PROVIDE (edata = .);
197   __bss_start = .;
198   .bss            :
199   {
200     *(.dynbss)
201     *(.bss .bss.* .gnu.linkonce.b.*)
202     *(COMMON)
203     /* Align here to ensure that the .bss section occupies space up to
204        _end.  Align after .bss to ensure correct alignment even if the
205        .bss section disappears because there are no input sections.  */
206     . = ALIGN(8);
207   } >INTRAM AT>INTRAM :INTRAM
208   . = ALIGN(8);
209   _end = .;
210   PROVIDE (end = .);
211   __heap_start__ = ALIGN(8);
212   .heap           :
213   {
214     *(.heap)
215     . = (__heap_size__ == __max_heap_size__) ?
216         ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ - ABSOLUTE(.) :
217         __heap_size__;
218   } >INTRAM AT>INTRAM :INTRAM
219   __heap_end__ = .;
220   /* Stabs debugging sections.  */
221   .stab          0 : { *(.stab) }
222   .stabstr       0 : { *(.stabstr) }
223   .stab.excl     0 : { *(.stab.excl) }
224   .stab.exclstr  0 : { *(.stab.exclstr) }
225   .stab.index    0 : { *(.stab.index) }
226   .stab.indexstr 0 : { *(.stab.indexstr) }
227   .comment       0 : { *(.comment) }
228   /* DWARF debug sections.
229      Symbols in the DWARF debugging sections are relative to the beginning
230      of the section so we begin them at 0.  */
231   /* DWARF 1 */
232   .debug          0 : { *(.debug) }
233   .line           0 : { *(.line) }
234   /* GNU DWARF 1 extensions */
235   .debug_srcinfo  0 : { *(.debug_srcinfo) }
236   .debug_sfnames  0 : { *(.debug_sfnames) }
237   /* DWARF 1.1 and DWARF 2 */
238   .debug_aranges  0 : { *(.debug_aranges) }
239   .debug_pubnames 0 : { *(.debug_pubnames) }
240   /* DWARF 2 */
241   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
242   .debug_abbrev   0 : { *(.debug_abbrev) }
243   .debug_line     0 : { *(.debug_line) }
244   .debug_frame    0 : { *(.debug_frame) }
245   .debug_str      0 : { *(.debug_str) }
246   .debug_loc      0 : { *(.debug_loc) }
247   .debug_macinfo  0 : { *(.debug_macinfo) }
248   /* SGI/MIPS DWARF 2 extensions */
249   .debug_weaknames 0 : { *(.debug_weaknames) }
250   .debug_funcnames 0 : { *(.debug_funcnames) }
251   .debug_typenames 0 : { *(.debug_typenames) }
252   .debug_varnames  0 : { *(.debug_varnames) }
253   .stack         ORIGIN(INTRAM) + LENGTH(INTRAM) - __stack_size__ :
254   {
255     _stack = .;
256     *(.stack)
257     . = __stack_size__;
258     _estack = .;
259   } >INTRAM AT>INTRAM :INTRAM
260   .userpage       : { *(.userpage .userpage.*) } >USERPAGE AT>USERPAGE :USERPAGE
261   .factorypage    : { *(.factorypage .factorypage.*) } >FACTORYPAGE AT>FACTORYPAGE :FACTORYPAGE
262   /DISCARD/ : { *(.note.GNU-stack) }
263 }