Add debug and openocd scripts for rom/ram operations;remove old scripts.
[bertos.git] / cpu / arm / scripts / at91sam7s256_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(_init)
83 SEARCH_DIR(.)
84 OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
85 OUTPUT_ARCH(arm)
86
87 /*
88  * Define memory configuration for AT91SAM7S
89  */
90 MEMORY
91 {
92   rom(rx) : org = 0x00100000, len = 256k
93   ram(rwx) : org = 0x00200000, len = 64k
94 }
95
96
97 /*
98  * Define stack size here
99  */
100 FIQ_STACK_SIZE = 0x0100;
101 IRQ_STACK_SIZE = 0x0100;
102 ABT_STACK_SIZE = 0x0100;
103 UND_STACK_SIZE = 0x0100;
104 SVC_STACK_SIZE = 0x0400;
105
106 /*
107  * Allocate section memory
108  */
109 SECTIONS
110 {
111         .text :
112         {
113                 * (.vectors);
114                 . = ALIGN (4);
115                 * (.init);
116                 . = ALIGN (4);
117                 * (.rodata);
118                 . = ALIGN (4);
119                 * (.rodata*);
120                 . = ALIGN (4);
121                 * (.text);
122                 . = ALIGN (4);
123                 *(.glue_7t);
124                 . = ALIGN(4);
125                 *(.glue_7);
126                 . = ALIGN(4);
127         } > rom
128
129         _etext = .;
130         PROVIDE (__etext = .);
131
132         .data : AT (__etext)
133         {
134                 PROVIDE (__data_start = .);
135                 * (.data)
136                 . = ALIGN (4);
137                 _edata = .;
138                 PROVIDE (__data_end = .);
139         } > ram
140
141         .bss :
142         {
143                 PROVIDE (__bss_start = .);
144                 *(.bss)
145                 *(COMMON)
146                 . = ALIGN(4);
147                 PROVIDE (__bss_end = .);
148         } > ram
149
150 /*
151  * Allocate stack at the end of bss section.
152  * Data heap is allocate at end of stack.
153  */
154         PROVIDE (__stack_start = .);
155
156         PROVIDE (__stack_fiq_start = .);
157         . += FIQ_STACK_SIZE;
158         . = ALIGN(4);
159         PROVIDE (__stack_fiq_end = .);
160
161         PROVIDE (__stack_irq_start = .);
162         . += IRQ_STACK_SIZE;
163         . = ALIGN(4);
164         PROVIDE (__stack_irq_end = .);
165
166         PROVIDE (__stack_abt_start = .);
167         . += ABT_STACK_SIZE;
168         . = ALIGN(4);
169         PROVIDE (__stack_abt_end = .);
170
171         PROVIDE (__stack_und_start = .);
172         . += UND_STACK_SIZE;
173         . = ALIGN(4);
174         PROVIDE (__stack_und_end = .);
175
176         PROVIDE (__stack_svc_start = .);
177         . += SVC_STACK_SIZE;
178         . = ALIGN(4);
179         PROVIDE (__stack_svc_end = .);
180
181         PROVIDE (__stack_end = .);
182
183         PROVIDE (__heap_start = .);
184
185 }