6dc69c75f18cdeb95958ffdb3b22fcffa058e6df
[bertos.git] / cpu / arm / scripts / sam7s256_rom.ld
1 /**
2  * \file
3  * <!--
4  * This file is part of BeRTOS.
5  *
6  * Bertos is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  *
20  * As a special exception, you may use this file as part of a free software
21  * library without restriction.  Specifically, if other files instantiate
22  * templates or use macros or inline functions from this file, or you compile
23  * this file and link it with other files to produce an executable, this
24  * file does not by itself cause the resulting executable to be covered by
25  * the GNU General Public License.  This exception does not however
26  * invalidate any other reasons why the executable file might be covered by
27  * the GNU General Public License.
28  *
29  * Copyright 2007 Develer S.r.l. (http://www.develer.com/)
30  *
31  * -->
32  *
33  * \version $Id: sysirq_at91.c 18273 2007-10-11 14:53:02Z batt $
34  *
35  * \author Daniele Basile <asterix@develer.com>
36  *
37  * \brief Script linker for Atmel AT91 SAM7S256 processors.
38  *
39  */
40
41 /**
42  * \file
43  * <!--
44  * This file is part of BeRTOS.
45  *
46  * Bertos is free software; you can redistribute it and/or modify
47  * it under the terms of the GNU General Public License as published by
48  * the Free Software Foundation; either version 2 of the License, or
49  * (at your option) any later version.
50  *
51  * This program is distributed in the hope that it will be useful,
52  * but WITHOUT ANY WARRANTY; without even the implied warranty of
53  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
54  * GNU General Public License for more details.
55  *
56  * You should have received a copy of the GNU General Public License
57  * along with this program; if not, write to the Free Software
58  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
59  *
60  * As a special exception, you may use this file as part of a free software
61  * library without restriction.  Specifically, if other files instantiate
62  * templates or use macros or inline functions from this file, or you compile
63  * this file and link it with other files to produce an executable, this
64  * file does not by itself cause the resulting executable to be covered by
65  * the GNU General Public License.  This exception does not however
66  * invalidate any other reasons why the executable file might be covered by
67  * the GNU General Public License.
68  *
69  * Copyright 2007 Develer S.r.l. (http://www.develer.com/)
70  *
71  * -->
72  *
73  * \version $Id: sysirq_at91.c 18273 2007-10-11 14:53:02Z batt $
74  *
75  * \author Daniele Basile <asterix@develer.com>
76  *
77  * \brief Script linker for Atmel AT91 SAM7S256 processors.
78  *
79  */
80
81
82 ENTRY(ResetHandler)
83 SEARCH_DIR(.)
84 OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
85 OUTPUT_ARCH(arm)
86
87
88 /*
89  * Define stack size here
90  */
91 FIQ_STACK_SIZE = 0x0100;
92 IRQ_STACK_SIZE = 0x0100;
93 ABT_STACK_SIZE = 0x0100;
94 UND_STACK_SIZE = 0x0100;
95 SVC_STACK_SIZE = 0x0400;
96
97 /*
98  * Define memory configuration for AT91SAM7S
99  */
100 MEMORY
101 {
102   rom(rx) : org = 0x00000000, len = 256k
103   ram(rw) : org = 0x00200000, len = 64k
104 }
105
106 /*
107  * Allocate section memory
108  */
109 SECTIONS
110 {
111     .text :
112     {
113             * ( .vectors );
114             . = ALIGN ( 4 );
115             * ( .init );
116             . = ALIGN ( 4 );
117         } > rom
118
119         . = ALIGN ( 4 );
120         _etext = .;
121         PROVIDE ( __etext = . );
122
123         .data : AT ( __etext )
124         {
125                 PROVIDE ( __data_start = . );
126                 * ( .data )
127                 . = ALIGN ( 4 );
128                 _edata = .;
129                 PROVIDE ( __data_end = . );
130         }
131         > ram
132
133 /*
134  * Allocate bss section and stack.
135  */
136         .bss :
137         {
138                 PROVIDE (__bss_start = .);
139                 *(.bss)
140                 *(COMMON)
141                 . = ALIGN(4);
142                 PROVIDE (__bss_end = .);
143
144                 . = ALIGN(256);
145
146                 PROVIDE (__stack_start = .);
147
148                 PROVIDE (__stack_fiq_start = .);
149                 . += FIQ_STACK_SIZE;
150                 . = ALIGN(4);
151                 PROVIDE (__stack_fiq_end = .);
152
153                 PROVIDE (__stack_irq_start = .);
154                 . += IRQ_STACK_SIZE;
155                 . = ALIGN(4);
156                 PROVIDE (__stack_irq_end = .);
157
158                 PROVIDE (__stack_abt_start = .);
159                 . += ABT_STACK_SIZE;
160                 . = ALIGN(4);
161                 PROVIDE (__stack_abt_end = .);
162
163                 PROVIDE (__stack_und_start = .);
164                 . += UND_STACK_SIZE;
165                 . = ALIGN(4);
166                 PROVIDE (__stack_und_end = .);
167
168                 PROVIDE (__stack_svc_start = .);
169                 . += SVC_STACK_SIZE;
170                 . = ALIGN(4);
171                 PROVIDE (__stack_svc_end = .);
172
173                 PROVIDE (__stack_end = .);
174
175                 PROVIDE (__heap_start = .);
176         } > ram
177
178 }