]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_M4F_ATSAM4E_Atmel_Studio/src/ASF/sam/utils/linker_scripts/sam4e/sam4e16e/gcc/flash.ld
d01ef3ef3cad48a97f96f170562aeb1736bf4ee1
[freertos] / FreeRTOS / Demo / CORTEX_M4F_ATSAM4E_Atmel_Studio / src / ASF / sam / utils / linker_scripts / sam4e / sam4e16e / gcc / flash.ld
1 /**\r
2  * \file\r
3  *\r
4  * \brief Flash Linker script for SAM.\r
5  *\r
6  * Copyright (c) 2012 Atmel Corporation. All rights reserved.\r
7  *\r
8  * \asf_license_start\r
9  *\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
12  * \r
13  * 1. Redistributions of source code must retain the above copyright notice, \r
14  *    this list of conditions and the following disclaimer.\r
15  * \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
19  * \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
22  * \r
23  * 4. This software may only be redistributed and used in connection with an \r
24  *    Atmel microcontroller product.\r
25  * \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
37  *\r
38  * \asf_license_stop\r
39  *\r
40  */\r
41 \r
42 OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")\r
43 OUTPUT_ARCH(arm)\r
44 SEARCH_DIR(.)\r
45 \r
46 /* Memory Spaces Definitions */\r
47 MEMORY\r
48 {\r
49   rom (rx)  : ORIGIN = 0x00400000, LENGTH = 0x00100000\r
50   ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00020000\r
51 }\r
52 \r
53 /* The stack size used by the application. NOTE: you need to adjust according to your application. */\r
54 STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : 0x3000;\r
55 \r
56 SECTIONS\r
57 {\r
58     .text :\r
59     {\r
60         . = ALIGN(4);\r
61         _sfixed = .;\r
62         KEEP(*(.vectors .vectors.*))\r
63         *(.text .text.* .gnu.linkonce.t.*)\r
64         *(.glue_7t) *(.glue_7)\r
65         *(.rodata .rodata* .gnu.linkonce.r.*)\r
66         *(.ARM.extab* .gnu.linkonce.armextab.*)\r
67 \r
68         /* Support C constructors, and C destructors in both user code\r
69            and the C library. This also provides support for C++ code. */\r
70         . = ALIGN(4);\r
71         KEEP(*(.init))\r
72         . = ALIGN(4);\r
73         __preinit_array_start = .;\r
74         KEEP (*(.preinit_array))\r
75         __preinit_array_end = .;\r
76 \r
77         . = ALIGN(4);\r
78         __init_array_start = .;\r
79         KEEP (*(SORT(.init_array.*)))\r
80         KEEP (*(.init_array))\r
81         __init_array_end = .;\r
82 \r
83         . = ALIGN(0x4);\r
84         KEEP (*crtbegin.o(.ctors))\r
85         KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))\r
86         KEEP (*(SORT(.ctors.*)))\r
87         KEEP (*crtend.o(.ctors))\r
88 \r
89         . = ALIGN(4);\r
90         KEEP(*(.fini))\r
91 \r
92         . = ALIGN(4);\r
93         __fini_array_start = .;\r
94         KEEP (*(.fini_array))\r
95         KEEP (*(SORT(.fini_array.*)))\r
96         __fini_array_end = .;\r
97 \r
98         KEEP (*crtbegin.o(.dtors))\r
99         KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))\r
100         KEEP (*(SORT(.dtors.*)))\r
101         KEEP (*crtend.o(.dtors))\r
102 \r
103         . = ALIGN(4);\r
104         _efixed = .;            /* End of text section */\r
105     } > rom\r
106 \r
107     /* .ARM.exidx is sorted, so has to go in its own output section.  */\r
108     PROVIDE_HIDDEN (__exidx_start = .);\r
109     .ARM.exidx :\r
110     {\r
111       *(.ARM.exidx* .gnu.linkonce.armexidx.*)\r
112     } > rom\r
113     PROVIDE_HIDDEN (__exidx_end = .);\r
114 \r
115     . = ALIGN(4);\r
116     _etext = .;\r
117 \r
118     .relocate : AT (_etext)\r
119     {\r
120         . = ALIGN(4);\r
121         _srelocate = .;\r
122         *(.ramfunc .ramfunc.*);\r
123         *(.data .data.*);\r
124         . = ALIGN(4);\r
125         _erelocate = .;\r
126     } > ram\r
127 \r
128     /* .bss section which is used for uninitialized data */\r
129     .bss (NOLOAD) :\r
130     {\r
131         . = ALIGN(4);\r
132         _sbss = . ;\r
133         _szero = .;\r
134         *(.bss .bss.*)\r
135         *(COMMON)\r
136         . = ALIGN(4);\r
137         _ebss = . ;\r
138         _ezero = .;\r
139     } > ram\r
140 \r
141     /* stack section */\r
142     .stack (NOLOAD):\r
143     {\r
144         . = ALIGN(8);\r
145         _sstack = .;\r
146         . = . + STACK_SIZE;\r
147         . = ALIGN(8);\r
148         _estack = .;\r
149     } > ram\r
150 \r
151     . = ALIGN(4);\r
152     _end = . ;\r
153 }\r