4 * \brief Flash Linker script for SAM.
\r
6 * Copyright (c) 2011 Atmel Corporation. All rights reserved.
\r
10 * Redistribution and use in source and binary forms, with or without
\r
11 * modification, are permitted provided that the following conditions are met:
\r
13 * 1. Redistributions of source code must retain the above copyright notice,
\r
14 * this list of conditions and the following disclaimer.
\r
16 * 2. Redistributions in binary form must reproduce the above copyright notice,
\r
17 * this list of conditions and the following disclaimer in the documentation
\r
18 * and/or other materials provided with the distribution.
\r
20 * 3. The name of Atmel may not be used to endorse or promote products derived
\r
21 * from this software without specific prior written permission.
\r
23 * 4. This software may only be redistributed and used in connection with an
\r
24 * Atmel microcontroller product.
\r
26 * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
\r
27 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
\r
28 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
\r
29 * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
\r
30 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
\r
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
\r
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
\r
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
\r
34 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
\r
35 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
\r
36 * POSSIBILITY OF SUCH DAMAGE.
\r
42 OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
\r
46 /* Memory Spaces Definitions */
\r
49 rom (rx) : ORIGIN = 0x00400000, LENGTH = 0x00100000 /* flash, 1024K */
\r
50 ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00020000 /* sram, 128K */
\r
53 /* The stack size used by the application. NOTE: you need to adjust according to your application. */
\r
54 STACK_SIZE = 0x3000;
\r
56 /* Section Definitions */
\r
63 KEEP(*(.vectors .vectors.*))
\r
64 *(.text .text.* .gnu.linkonce.t.*)
\r
65 *(.glue_7t) *(.glue_7)
\r
66 *(.rodata .rodata* .gnu.linkonce.r.*)
\r
67 *(.ARM.extab* .gnu.linkonce.armextab.*)
\r
69 /* Support C constructors, and C destructors in both user code
\r
70 and the C library. This also provides support for C++ code. */
\r
74 __preinit_array_start = .;
\r
75 KEEP (*(.preinit_array))
\r
76 __preinit_array_end = .;
\r
79 __init_array_start = .;
\r
80 KEEP (*(SORT(.init_array.*)))
\r
81 KEEP (*(.init_array))
\r
82 __init_array_end = .;
\r
85 KEEP (*crtbegin.o(.ctors))
\r
86 KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
\r
87 KEEP (*(SORT(.ctors.*)))
\r
88 KEEP (*crtend.o(.ctors))
\r
94 __fini_array_start = .;
\r
95 KEEP (*(.fini_array))
\r
96 KEEP (*(SORT(.fini_array.*)))
\r
97 __fini_array_end = .;
\r
99 KEEP (*crtbegin.o(.dtors))
\r
100 KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
\r
101 KEEP (*(SORT(.dtors.*)))
\r
102 KEEP (*crtend.o(.dtors))
\r
105 _efixed = .; /* End of text section */
\r
108 /* .ARM.exidx is sorted, so has to go in its own output section. */
\r
109 PROVIDE_HIDDEN (__exidx_start = .);
\r
112 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
\r
114 PROVIDE_HIDDEN (__exidx_end = .);
\r
119 .relocate : AT (_etext)
\r
123 *(.ramfunc .ramfunc.*);
\r
129 /* .bss section which is used for uninitialized data */
\r
142 /* stack section */
\r
147 . = . + STACK_SIZE;
\r