testing: fix str710 test case now builds
[fw/openocd] / testing / examples / STR710Test / prj / hitex_str7_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 = 0x40000000, LENGTH = 0x00040000
33         DATA (rw) : ORIGIN = 0x20000000, LENGTH = 0x00010000
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(*(.vectrom))
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 (__preinit_array_start = .);
87                 KEEP (*(.preinit_array))
88                 PROVIDE (__preinit_array_end = .);
89                 PROVIDE (__init_array_start = .);
90                 KEEP (*(SORT(.init_array.*)))
91                 KEEP (*(.init_array))
92                 PROVIDE (__init_array_end = .);
93                 PROVIDE (__fini_array_start = .);
94                 KEEP (*(.fini_array))
95                 KEEP (*(SORT(.fini_array.*)))
96                 PROVIDE (__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         _vectext = .;
110         PROVIDE (vectext = .);
111
112         .vect : AT (_vectext)
113         {
114                 _vecstart = .;
115                 KEEP(*(.vectram))
116                 _vecend = .;
117         } >DATA
118
119         _etext = _vectext + SIZEOF(.vect);
120         PROVIDE (etext = .);
121
122         /* .data section which is used for initialized data */
123
124         .data : AT (_etext)
125         {
126                 __data_start = .;
127                 *(.data .data.*)
128                 *(.gnu.linkonce.d.*)
129                 SORT(CONSTRUCTORS)
130                 . = ALIGN(4);
131                 *(.fastrun .fastrun.*)
132         } >DATA
133         . = ALIGN(4);
134         
135         _edata = .;
136         PROVIDE (edata = .);
137
138         /* .bss section which is used for uninitialized data */
139
140         .bss :
141         {
142                 __bss_start = .;
143                 __bss_start__ = .;
144                 *(.bss .bss.*)
145                 *(.gnu.linkonce.b.*)
146                 *(COMMON)
147                 . = ALIGN(4);
148         } >DATA
149         . = ALIGN(4);
150         __bss_end__ = .;
151         
152         _end = .;
153         PROVIDE(end = .);
154
155         /* .heap section which is used for memory allocation */
156         
157         .heap (NOLOAD) :
158         {
159                 __heap_start__ = .;
160                 *(.heap)
161                 . = MAX(__heap_start__ + _HEAPSIZE , .);
162         } >DATA
163         __heap_end__ = __heap_start__ + SIZEOF(.heap);
164         
165         /* .stack section - user mode stack */
166         
167         .stack (__heap_end__ + 3) / 4 * 4 (NOLOAD) :
168         {
169                 __stack_start__ = .;
170                 *(.stack)
171                 . = MAX(__stack_start__ + _STACKSIZE , .);
172         } >DATA
173         __stack_end__ = __stack_start__ + SIZEOF(.stack);
174
175         /* .stack_irq section */
176         
177         .stack_irq (__stack_end__ + 3) / 4 * 4 (NOLOAD) :
178         {
179                 __stack_irq_start__ = .;
180                 *(.stack_irq)
181                 . = MAX(__stack_irq_start__ + _STACKSIZE_IRQ , .);
182         } >DATA
183         __stack_irq_end__ = __stack_irq_start__ + SIZEOF(.stack_irq);
184
185         /* .stack_fiq section */
186         
187         .stack_fiq (__stack_irq_end__ + 3) / 4 * 4 (NOLOAD) :
188         {
189                 __stack_fiq_start__ = .;
190                 *(.stack_fiq)
191             . = MAX(__stack_fiq_start__ + _STACKSIZE_FIQ , .);
192         } >DATA
193         __stack_fiq_end__ = __stack_fiq_start__ + SIZEOF(.stack_fiq);
194
195         /* .stack_svc section */
196         
197         .stack_svc (__stack_fiq_end__ + 3) / 4 * 4 (NOLOAD) :
198         {
199                 __stack_svc_start__ = .;
200                 *(.stack_svc)
201                 . = MAX(__stack_svc_start__ + _STACKSIZE_SVC , .);
202         } >DATA
203         __stack_svc_end__ = __stack_svc_start__ + SIZEOF(.stack_svc);
204
205         /* .stack_abt section */
206         
207         .stack_abt (__stack_svc_end__ + 3) / 4 * 4 (NOLOAD) :
208         {
209                 __stack_abt_start__ = .;
210                 *(.stack_abt)
211                 . = MAX(__stack_abt_start__ + _STACKSIZE_ABT , .);
212         } >DATA
213         __stack_abt_end__ = __stack_abt_start__ + SIZEOF(.stack_abt);
214
215         /* .stack_und section */
216         
217         .stack_und (__stack_abt_end__ + 3) / 4 * 4 (NOLOAD) :
218         {
219                 __stack_und_start__ = .;
220                 *(.stack_und)
221         . = MAX(__stack_und_start__ + _STACKSIZE_UND , .);
222         } >DATA
223         __stack_und_end__ = __stack_und_start__ + SIZEOF(.stack_und);
224   
225         /* Stabs debugging sections.  */
226         .stab          0 : { *(.stab) }
227         .stabstr       0 : { *(.stabstr) }
228         .stab.excl     0 : { *(.stab.excl) }
229         .stab.exclstr  0 : { *(.stab.exclstr) }
230         .stab.index    0 : { *(.stab.index) }
231         .stab.indexstr 0 : { *(.stab.indexstr) }
232         .comment       0 : { *(.comment) }
233         /* DWARF debug sections.
234                 Symbols in the DWARF debugging sections are relative to the beginning
235                 of the section so we begin them at 0.  */
236         /* DWARF 1 */
237         .debug          0 : { *(.debug) }
238         .line           0 : { *(.line) }
239         /* GNU DWARF 1 extensions */
240         .debug_srcinfo  0 : { *(.debug_srcinfo) }
241         .debug_sfnames  0 : { *(.debug_sfnames) }
242         /* DWARF 1.1 and DWARF 2 */
243         .debug_aranges  0 : { *(.debug_aranges) }
244         .debug_pubnames 0 : { *(.debug_pubnames) }
245         /* DWARF 2 */
246         .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
247         .debug_abbrev   0 : { *(.debug_abbrev) }
248         .debug_line     0 : { *(.debug_line) }
249         .debug_frame    0 : { *(.debug_frame) }
250         .debug_str      0 : { *(.debug_str) }
251         .debug_loc      0 : { *(.debug_loc) }
252         .debug_macinfo  0 : { *(.debug_macinfo) }
253         /* SGI/MIPS DWARF 2 extensions */
254         .debug_weaknames 0 : { *(.debug_weaknames) }
255         .debug_funcnames 0 : { *(.debug_funcnames) }
256         .debug_typenames 0 : { *(.debug_typenames) }
257         .debug_varnames  0 : { *(.debug_varnames) }     
258 }
259