1 /* ----------------------------------------------------------------------------
\r
2 * SAM Software Package License
\r
3 * ----------------------------------------------------------------------------
\r
4 * Copyright (c) 2015, Atmel Corporation
\r
6 * All rights reserved.
\r
8 * Redistribution and use in source and binary forms, with or without
\r
9 * modification, are permitted provided that the following conditions are met:
\r
11 * - Redistributions of source code must retain the above copyright notice,
\r
12 * this list of conditions and the disclaimer below.
\r
14 * Atmel's name may not be used to endorse or promote products derived from
\r
15 * this software without specific prior written permission.
\r
17 * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
\r
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
\r
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
\r
20 * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
\r
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
\r
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
\r
23 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
\r
24 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
\r
25 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
\r
26 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\r
27 * ----------------------------------------------------------------------------
\r
30 /*------------------------------------------------------------------------------
\r
31 * Linker script for running in internal SRAM on the SAMA5D2
\r
32 *----------------------------------------------------------------------------*/
\r
34 OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
\r
39 /* Memory Spaces Definitions */
\r
42 sram (W!RX) : ORIGIN = 0x200000, LENGTH = 128K /* sram */
\r
43 ddr (W!RX) : ORIGIN = 0x20000000, LENGTH = 64M /* ddr */
\r
44 ddr_nocache (RWX) : ORIGIN = 0x24000000, LENGTH = 16M /* ddr (non-cached) */
\r
47 /* Sizes of the stacks used by the application. NOTE: you need to adjust */
\r
48 C_STACK_SIZE = 0x3000;
\r
49 IRQ_STACK_SIZE = 0x60;
\r
50 FIQ_STACK_SIZE = 0x60;
\r
51 SYS_STACK_SIZE = 0x40;
\r
52 ABT_STACK_SIZE = 0x40;
\r
53 UND_STACK_SIZE = 0x40;
\r
56 /* Section Definitions */
\r
63 KEEP(*(.vectors .vectors.*))
\r
65 *(.text .text.* .gnu.linkonce.t.*)
\r
66 *(.glue_7t) *(.glue_7)
\r
68 *(.rodata .rodata* .gnu.linkonce.r.*)
\r
69 *(.ARM.extab* .gnu.linkonce.armextab.*)
\r
71 /* Support C constructors, and C destructors in both user code
\r
72 and the C library. This also provides support for C++ code. */
\r
76 __preinit_array_start = .;
\r
77 KEEP (*(.preinit_array))
\r
78 __preinit_array_end = .;
\r
81 __init_array_start = .;
\r
82 KEEP (*(SORT(.init_array.*)))
\r
83 KEEP (*(.init_array))
\r
84 __init_array_end = .;
\r
87 KEEP (*crtbegin.o(.ctors))
\r
88 KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
\r
89 KEEP (*(SORT(.ctors.*)))
\r
90 KEEP (*crtend.o(.ctors))
\r
96 __fini_array_start = .;
\r
97 KEEP (*(.fini_array))
\r
98 KEEP (*(SORT(.fini_array.*)))
\r
99 __fini_array_end = .;
\r
101 KEEP (*crtbegin.o(.dtors))
\r
102 KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
\r
103 KEEP (*(SORT(.dtors.*)))
\r
104 KEEP (*crtend.o(.dtors))
\r
107 _efixed = .; /* End of text section */
\r
109 /* no relocation when running from sram */
\r
114 /* .ARM.exidx is sorted, so has to go in its own output section. */
\r
115 PROVIDE_HIDDEN (__exidx_start = .);
\r
118 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
\r
120 PROVIDE_HIDDEN (__exidx_end = .);
\r
125 .region_sram (NOLOAD) :
\r
131 .region_ddr (NOLOAD) :
\r
137 .region_ddr_nocache (NOLOAD) :
\r
140 *(.region_ddr_nocache)
\r
143 /* .bss section which is used for uninitialized data */
\r
158 __stack_start__ = . ;
\r
160 . += IRQ_STACK_SIZE;
\r
164 . += FIQ_STACK_SIZE;
\r
168 . += ABT_STACK_SIZE;
\r
172 . += UND_STACK_SIZE;
\r
176 . += SYS_STACK_SIZE;
\r