804149d213a8b5920df696ea3f58754bb1fdbc13
[fw/openocd] / testing / examples / STR912Test / prj / str912_rom.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         CODE (rx) : ORIGIN = 0x00000000, LENGTH = 0x00080000
33         DATA (rw) : ORIGIN = 0x04000000, LENGTH = 0x00018000
34 }
35
36 /* Section Definitions */
37
38 SECTIONS
39 {
40         /* first section is .text which is used for code */
41
42         .text :
43         {
44                 CREATE_OBJECT_SYMBOLS
45                 KEEP(*(.vectors))
46                 KEEP(*(.init))
47                 *(.text .text.*)
48                 *(.gnu.linkonce.t.*)
49                 *(.glue_7t) *(.glue_7) *(.vfp11_veneer)
50                 KEEP(*(.fini))
51                 *(.gcc_except_table)
52         } >CODE =0
53         . = ALIGN(4);
54
55         /* .ctors .dtors are used for c++ constructors/destructors */
56         
57         .ctors :
58         {
59                 PROVIDE(__ctors_start__ = .);
60                 KEEP(*(SORT(.ctors.*)))
61                 KEEP(*(.ctors))
62                 PROVIDE(__ctors_end__ = .);
63         } >CODE
64
65         .dtors :
66         {
67                 PROVIDE(__dtors_start__ = .); 
68                 KEEP(*(SORT(.dtors.*)))
69                 KEEP(*(.dtors))
70                 PROVIDE(__dtors_end__ = .);
71         } >CODE
72         
73         /* .rodata section which is used for read-only data (constants) */
74
75         .rodata :
76         {
77                 *(.rodata .rodata.*)
78                 *(.gnu.linkonce.r.*)
79         } >CODE
80         . = ALIGN(4);
81
82         .init_array :
83         {
84                 *(.init)
85         *(.fini)
86                 PROVIDE_HIDDEN (__preinit_array_start = .);
87                 KEEP (*(.preinit_array))
88                 PROVIDE_HIDDEN (__preinit_array_end = .);
89                 PROVIDE_HIDDEN (__init_array_start = .);
90                 KEEP (*(SORT(.init_array.*)))
91                 KEEP (*(.init_array))
92                 PROVIDE_HIDDEN (__init_array_end = .);
93                 PROVIDE_HIDDEN (__fini_array_start = .);
94                 KEEP (*(.fini_array))
95                 KEEP (*(SORT(.fini_array.*)))
96                 PROVIDE_HIDDEN (__fini_array_end = .);
97         } >CODE
98
99         . = ALIGN(4);
100
101         /* .ARM.exidx is sorted, so has to go in its own output section.  */
102         __exidx_start = .;
103         .ARM.exidx :
104         {
105                 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
106         } >CODE
107         __exidx_end = .;
108
109         _etext = .;
110         PROVIDE (etext = .);
111
112         /* .data section which is used for initialized data */
113
114         .data : AT (_etext)
115         {
116                 __data_start = .;
117                 *(.data .data.*)
118                 *(.gnu.linkonce.d.*)
119                 SORT(CONSTRUCTORS)
120                 . = ALIGN(4);
121                 *(.fastrun .fastrun.*)
122         } >DATA
123         . = ALIGN(4);
124         
125         _edata = .;
126         PROVIDE (edata = .);
127
128         /* .bss section which is used for uninitialized data */
129
130         .bss :
131         {
132                 __bss_start = .;
133                 __bss_start__ = .;
134                 *(.bss .bss.*)
135                 *(.gnu.linkonce.b.*)
136                 *(COMMON)
137                 . = ALIGN(4);
138         } >DATA
139         . = ALIGN(4);
140         __bss_end__ = .;
141         
142         _end = .;
143         PROVIDE(end = .);
144
145         /* .heap section which is used for memory allocation */
146         
147         .heap (NOLOAD) :
148         {
149                 __heap_start__ = .;
150                 *(.heap)
151                 . = MAX(__heap_start__ + _HEAPSIZE , .);
152         } >DATA
153         __heap_end__ = __heap_start__ + SIZEOF(.heap);
154         
155         /* .stack section - user mode stack */
156         
157         .stack (__heap_end__ + 3) / 4 * 4 (NOLOAD) :
158         {
159                 __stack_start__ = .;
160                 *(.stack)
161                 . = MAX(__stack_start__ + _STACKSIZE , .);
162         } >DATA
163         __stack_end__ = __stack_start__ + SIZEOF(.stack);
164
165         /* .stack_irq section */
166         
167         .stack_irq (__stack_end__ + 3) / 4 * 4 (NOLOAD) :
168         {
169                 __stack_irq_start__ = .;
170                 *(.stack_irq)
171                 . = MAX(__stack_irq_start__ + _STACKSIZE_IRQ , .);
172         } >DATA
173         __stack_irq_end__ = __stack_irq_start__ + SIZEOF(.stack_irq);
174
175         /* .stack_fiq section */
176         
177         .stack_fiq (__stack_irq_end__ + 3) / 4 * 4 (NOLOAD) :
178         {
179                 __stack_fiq_start__ = .;
180                 *(.stack_fiq)
181             . = MAX(__stack_fiq_start__ + _STACKSIZE_FIQ , .);
182         } >DATA
183         __stack_fiq_end__ = __stack_fiq_start__ + SIZEOF(.stack_fiq);
184
185         /* .stack_svc section */
186         
187         .stack_svc (__stack_fiq_end__ + 3) / 4 * 4 (NOLOAD) :
188         {
189                 __stack_svc_start__ = .;
190                 *(.stack_svc)
191                 . = MAX(__stack_svc_start__ + _STACKSIZE_SVC , .);
192         } >DATA
193         __stack_svc_end__ = __stack_svc_start__ + SIZEOF(.stack_svc);
194
195         /* .stack_abt section */
196         
197         .stack_abt (__stack_svc_end__ + 3) / 4 * 4 (NOLOAD) :
198         {
199                 __stack_abt_start__ = .;
200                 *(.stack_abt)
201                 . = MAX(__stack_abt_start__ + _STACKSIZE_ABT , .);
202         } >DATA
203         __stack_abt_end__ = __stack_abt_start__ + SIZEOF(.stack_abt);
204
205         /* .stack_und section */
206         
207         .stack_und (__stack_abt_end__ + 3) / 4 * 4 (NOLOAD) :
208         {
209                 __stack_und_start__ = .;
210                 *(.stack_und)
211         . = MAX(__stack_und_start__ + _STACKSIZE_UND , .);
212         } >DATA
213         __stack_und_end__ = __stack_und_start__ + SIZEOF(.stack_und);
214   
215         /* Stabs debugging sections.  */
216         .stab          0 : { *(.stab) }
217         .stabstr       0 : { *(.stabstr) }
218         .stab.excl     0 : { *(.stab.excl) }
219         .stab.exclstr  0 : { *(.stab.exclstr) }
220         .stab.index    0 : { *(.stab.index) }
221         .stab.indexstr 0 : { *(.stab.indexstr) }
222         .comment       0 : { *(.comment) }
223         /* DWARF debug sections.
224                 Symbols in the DWARF debugging sections are relative to the beginning
225                 of the section so we begin them at 0.  */
226         /* DWARF 1 */
227         .debug          0 : { *(.debug) }
228         .line           0 : { *(.line) }
229         /* GNU DWARF 1 extensions */
230         .debug_srcinfo  0 : { *(.debug_srcinfo) }
231         .debug_sfnames  0 : { *(.debug_sfnames) }
232         /* DWARF 1.1 and DWARF 2 */
233         .debug_aranges  0 : { *(.debug_aranges) }
234         .debug_pubnames 0 : { *(.debug_pubnames) }
235         /* DWARF 2 */
236         .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
237         .debug_abbrev   0 : { *(.debug_abbrev) }
238         .debug_line     0 : { *(.debug_line) }
239         .debug_frame    0 : { *(.debug_frame) }
240         .debug_str      0 : { *(.debug_str) }
241         .debug_loc      0 : { *(.debug_loc) }
242         .debug_macinfo  0 : { *(.debug_macinfo) }
243         /* SGI/MIPS DWARF 2 extensions */
244         .debug_weaknames 0 : { *(.debug_weaknames) }
245         .debug_funcnames 0 : { *(.debug_funcnames) }
246         .debug_typenames 0 : { *(.debug_typenames) }
247         .debug_varnames  0 : { *(.debug_varnames) }     
248 }
249