269ada9bfaed3d9859cc8ac70471a36707891c94
[fw/openocd] / testing / examples / STR912Test / prj / str912_ram.ld
1 /***********************************************************************************
2 *       Copyright 2005 Anglia Design
3 *       This demo code and associated components are provided as is and has no warranty,
4 *       implied or otherwise.  You are free to use/modify any of the provided
5 *       code at your own risk in your applications with the expressed limitation
6 *       of liability (see below)
7
8 *       LIMITATION OF LIABILITY:   ANGLIA OR ANGLIA DESIGNS SHALL NOT BE LIABLE FOR ANY
9 *       LOSS OF PROFITS, LOSS OF USE, LOSS OF DATA, INTERRUPTION OF BUSINESS, NOR FOR
10 *       INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND WHETHER UNDER
11 *       THIS AGREEMENT OR OTHERWISE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
12 *
13 *       Author                  : Spencer Oliver
14 *       Web                     : www.anglia-designs.com
15 *
16 ***********************************************************************************/
17
18 /* Stack Sizes */
19
20         _STACKSIZE     = 1024;
21         _STACKSIZE_IRQ = 256;
22         _STACKSIZE_FIQ = 0;
23         _STACKSIZE_SVC = 1024;
24         _STACKSIZE_ABT = 0;
25         _STACKSIZE_UND = 0;
26         _HEAPSIZE      = 1024;
27
28 /* Memory Definitions */
29
30 MEMORY
31 {
32         DATA (rw) : ORIGIN = 0x04000000, LENGTH = 0x00018000
33 }
34
35 /* Section Definitions */
36
37 SECTIONS
38 {
39         /* first section is .text which is used for code */
40
41         .text :
42         {
43                 KEEP(*(.vectors))
44                 KEEP(*(.init))
45                 *(.text .text.*)
46                 *(.gnu.linkonce.t.*)
47                 *(.glue_7t .glue_7)
48                 KEEP(*(.fini))
49                 *(.gcc_except_table)
50         } >DATA =0
51         . = ALIGN(4);
52
53         /* .ctors .dtors are used for c++ constructors/destructors */
54         
55         .ctors :
56         {
57                 PROVIDE(__ctors_start__ = .);
58                 KEEP(*(SORT(.ctors.*)))
59                 KEEP(*(.ctors))
60                 PROVIDE(__ctors_end__ = .);
61         } >DATA
62
63         .dtors :
64         {
65                 PROVIDE(__dtors_start__ = .); 
66                 KEEP(*(SORT(.dtors.*)))
67                 KEEP(*(.dtors))
68                 PROVIDE(__dtors_end__ = .);
69         } >DATA
70         
71         /* .rodata section which is used for read-only data (constants) */
72
73         .rodata :
74         {
75                 *(.rodata .rodata.*)
76                 *(.gnu.linkonce.r.*)
77         } >DATA
78         . = ALIGN(4);
79
80         _etext = .;
81         PROVIDE (etext = .);
82
83         /* .data section which is used for initialized data */
84
85         .data : AT (_etext)
86         {
87                 *(.data .data.*)
88                 *(.gnu.linkonce.d.*)
89                 SORT(CONSTRUCTORS)
90         } >DATA
91         . = ALIGN(4);
92         
93         __data_start = .;
94         _edata = .;
95         PROVIDE (edata = .);
96
97         /* .bss section which is used for uninitialized data */
98
99         .bss :
100         {
101                 __bss_start = .;
102                 __bss_start__ = .;
103                 *(.bss .bss.*)
104                 *(.gnu.linkonce.b.*)
105                 *(COMMON)
106                 . = ALIGN(4);
107         } >DATA
108         . = ALIGN(4);
109         __bss_end__ = .;
110         
111         _end = .;
112         PROVIDE(end = .);
113
114         /* .heap section which is used for memory allocation */
115         
116         .heap (NOLOAD) :
117         {
118                 __heap_start__ = .;
119                 *(.heap)
120                 . = MAX(__heap_start__ + _HEAPSIZE , .);
121         } >DATA
122         __heap_end__ = __heap_start__ + SIZEOF(.heap);
123         
124         /* .stack section - user mode stack */
125         
126         .stack (__heap_end__ + 3) / 4 * 4 (NOLOAD) :
127         {
128                 __stack_start__ = .;
129                 *(.stack)
130                 . = MAX(__stack_start__ + _STACKSIZE , .);
131         } >DATA
132         __stack_end__ = __stack_start__ + SIZEOF(.stack);
133
134         /* .stack_irq section */
135         
136         .stack_irq (__stack_end__ + 3) / 4 * 4 (NOLOAD) :
137         {
138                 __stack_irq_start__ = .;
139                 *(.stack_irq)
140                 . = MAX(__stack_irq_start__ + _STACKSIZE_IRQ , .);
141         } >DATA
142         __stack_irq_end__ = __stack_irq_start__ + SIZEOF(.stack_irq);
143
144         /* .stack_fiq section */
145         
146         .stack_fiq (__stack_irq_end__ + 3) / 4 * 4 (NOLOAD) :
147         {
148                 __stack_fiq_start__ = .;
149                 *(.stack_fiq)
150             . = MAX(__stack_fiq_start__ + _STACKSIZE_FIQ , .);
151         } >DATA
152         __stack_fiq_end__ = __stack_fiq_start__ + SIZEOF(.stack_fiq);
153
154         /* .stack_svc section */
155         
156         .stack_svc (__stack_fiq_end__ + 3) / 4 * 4 (NOLOAD) :
157         {
158                 __stack_svc_start__ = .;
159                 *(.stack_svc)
160                 . = MAX(__stack_svc_start__ + _STACKSIZE_SVC , .);
161         } >DATA
162         __stack_svc_end__ = __stack_svc_start__ + SIZEOF(.stack_svc);
163
164         /* .stack_abt section */
165         
166         .stack_abt (__stack_svc_end__ + 3) / 4 * 4 (NOLOAD) :
167         {
168                 __stack_abt_start__ = .;
169                 *(.stack_abt)
170                 . = MAX(__stack_abt_start__ + _STACKSIZE_ABT , .);
171         } >DATA
172         __stack_abt_end__ = __stack_abt_start__ + SIZEOF(.stack_abt);
173
174         /* .stack_und section */
175         
176         .stack_und (__stack_abt_end__ + 3) / 4 * 4 (NOLOAD) :
177         {
178                 __stack_und_start__ = .;
179                 *(.stack_und)
180         . = MAX(__stack_und_start__ + _STACKSIZE_UND , .);
181         } >DATA
182         __stack_und_end__ = __stack_und_start__ + SIZEOF(.stack_und);
183         
184         /* Stabs debugging sections.  */
185         .stab          0 : { *(.stab) }
186         .stabstr       0 : { *(.stabstr) }
187         .stab.excl     0 : { *(.stab.excl) }
188         .stab.exclstr  0 : { *(.stab.exclstr) }
189         .stab.index    0 : { *(.stab.index) }
190         .stab.indexstr 0 : { *(.stab.indexstr) }
191         .comment       0 : { *(.comment) }
192         /* DWARF debug sections.
193                 Symbols in the DWARF debugging sections are relative to the beginning
194                 of the section so we begin them at 0.  */
195         /* DWARF 1 */
196         .debug          0 : { *(.debug) }
197         .line           0 : { *(.line) }
198         /* GNU DWARF 1 extensions */
199         .debug_srcinfo  0 : { *(.debug_srcinfo) }
200         .debug_sfnames  0 : { *(.debug_sfnames) }
201         /* DWARF 1.1 and DWARF 2 */
202         .debug_aranges  0 : { *(.debug_aranges) }
203         .debug_pubnames 0 : { *(.debug_pubnames) }
204         /* DWARF 2 */
205         .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
206         .debug_abbrev   0 : { *(.debug_abbrev) }
207         .debug_line     0 : { *(.debug_line) }
208         .debug_frame    0 : { *(.debug_frame) }
209         .debug_str      0 : { *(.debug_str) }
210         .debug_loc      0 : { *(.debug_loc) }
211         .debug_macinfo  0 : { *(.debug_macinfo) }
212         /* SGI/MIPS DWARF 2 extensions */
213         .debug_weaknames 0 : { *(.debug_weaknames) }
214         .debug_funcnames 0 : { *(.debug_funcnames) }
215         .debug_typenames 0 : { *(.debug_typenames) }
216         .debug_varnames  0 : { *(.debug_varnames) }     
217 }
218