Update to new build system.
[clinton/Smoothieware.git] / mbed / src / vendor / NXP / cmsis / LPC2368 / GCC_CS / LPC2368.ld
1 OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
2 OUTPUT_ARCH(arm)
3 ENTRY(vectors)
4 GROUP(-lsupc++ -lm -lc -lcs3unhosted -lcs3 -lgcc)
5
6 /* Memory Definitions: */
7 MEMORY
8 {
9 Flash (rx) : ORIGIN = 0x00000000, LENGTH = 512k
10 Ram (rwx) : ORIGIN = 0x40000000, LENGTH = 32k
11 UsbRam (rw) : ORIGIN = 0x7FD00000, LENGTH = 8k
12 EthRam (rw) : ORIGIN = 0x7FE00000, LENGTH = 16k
13 CanRam (rw) : ORIGIN = 0xE0038000, LENGTH = 2k
14 BatRam (rw) : ORIGIN = 0xE0084000, LENGTH = 2k
15 }
16
17 /* Stack sizes: */
18 UND_Stack_Size = 16;
19 SVC_Stack_Size = 512;
20 ABT_Stack_Size = 16;
21 FIQ_Stack_Size = 16;
22 IRQ_Stack_Size = 256;
23 Stack_Size_Total = UND_Stack_Size + SVC_Stack_Size + ABT_Stack_Size + FIQ_Stack_Size + IRQ_Stack_Size;
24
25 /* Stack tops for each mode: */
26 __und_stack_top__ = __stacks_top__;
27 __abt_stack_top__ = __und_stack_top__ - UND_Stack_Size ;
28 __fiq_stack_top__ = __abt_stack_top__ - ABT_Stack_Size ;
29 __irq_stack_top__ = __fiq_stack_top__ - FIQ_Stack_Size ;
30 __svc_stack_top__ = __irq_stack_top__ - IRQ_Stack_Size ;
31
32 /* C-accessible symbols for memory address ranges: */
33 __FLASH_segment_start__ = ORIGIN( Flash );
34 __FLASH_segment_end__ = ORIGIN( Flash ) + LENGTH( Flash );
35 __SRAM_segment_start__ = ORIGIN( Ram );
36 __SRAM_segment_end__ = ORIGIN( Ram ) + LENGTH( Ram );
37
38 /* Stacks (full descending) at top of RAM, grows downward:
39 *
40 * __stack_min__ is used by the malloc implementation to ensure heap never collides
41 * with stack (assuming stack never grows beyond Stack_Size_Total in length) */
42 __stacks_top__ = __SRAM_segment_end__;
43 __stacks_min__ = __SRAM_segment_end__ - Stack_Size_Total;
44
45 SECTIONS
46 {
47 /* first section is .text which is used for code */
48 __text_start__ = . ;
49 .text : {
50 __privileged_code_start__ = . ;
51 KEEP( *( .vectors ) )
52 *( .privileged_code )
53
54 __privileged_code_end__ = .;
55
56 *( .text .text.* .gnu.linkonce.t.* )
57 *( .plt )
58 *( .gnu.warning )
59 *( .glue_7t ) *( .glue_7 ) *( .vfp11_veneer )
60
61 *( .rodata .rodata.* .gnu.linkonce.r.* )
62
63 *(.ARM.extab* .gnu.linkonce.armextab.*)
64 *(.gcc_except_table)
65 *(.eh_frame_hdr)
66 *(.eh_frame)
67
68 . = ALIGN( 4 ) ;
69 KEEP( *( .init ) )
70 . = ALIGN( 4 ) ;
71 __preinit_array_start = . ;
72 KEEP( *( .preinit_array ) )
73 __preinit_array_end = . ;
74 . = ALIGN( 4 ) ;
75 __init_array_start = . ;
76 KEEP( *( SORT( .init_array.* ) ) )
77 KEEP( *( .init_array ) )
78 __init_array_end = . ;
79
80 . = ALIGN( 4 ) ;
81 KEEP( *crtbegin.o( .ctors ) )
82 KEEP( *( EXCLUDE_FILE( *crtend.o ) .ctors ) )
83 KEEP( *( SORT( .ctors.* ) ) )
84 KEEP( *crtend.o( .ctors ) )
85
86 . = ALIGN( 4 ) ;
87 KEEP( *( .fini ) )
88 . = ALIGN( 4 ) ;
89 __fini_array_start = . ;
90 KEEP( *( .fini_array ) )
91 KEEP( *( SORT( .fini_array.* ) ) )
92 __fini_array_end = . ;
93
94 KEEP( *crtbegin.o( .dtors ) )
95 KEEP( *( EXCLUDE_FILE( *crtend.o ) .dtors ) )
96 KEEP( *( SORT( .dtors.* ) ) )
97 KEEP( *crtend.o( .dtors ) )
98
99 } >Flash
100
101 __exidx_start = . ;
102 .ARM.exidx : {
103 *( .ARM.exidx* .gnu.linkonce.armexidx.* )
104 } >Flash
105 __exidx_end = . ;
106
107 .text.align : { . = ALIGN( 8 ) ; } >Flash /* Alignment schenanigans */
108 __text_end__ = . ;
109
110 /* .bss section -- used for uninitialized data */
111 /* Located at the start of RAM */
112 .bss (NOLOAD) : {
113 __bss_start__ = . ;
114 *crt0.o( .ram_vectors )
115
116 __user_bss_start__ = . ;
117 *( .user_bss )
118 __user_bss_end__ = . ;
119
120 *( .shbss )
121 *( .bss .bss.* .gnu.linkonce.b.* )
122 *( COMMON )
123 *( .ram.b )
124 . = ALIGN( 8 ) ;
125
126 __bss_end__ = . ;
127 } >Ram AT>Flash
128
129 /* .data section -- used for initialized data */
130 .data : {
131 __data_start__ = . ;
132 KEEP( *( .jcr ) )
133 *( .got.plt ) *( .got )
134 *( .shdata )
135 *( .data .data.* .gnu.linkonce.d.* )
136 *( .ram )
137 . = ALIGN( 8 ) ;
138 __data_end__ = . ;
139 } >Ram AT>Flash
140
141 __data_init_start__ = LOADADDR( .data ) ;
142
143 /* Heap starts here and grows up in memory */
144 . = ALIGN( 8 ) ;
145 __heap_start__ = . ;
146
147 .stab 0 (NOLOAD) : { *(.stab) }
148 .stabstr 0 (NOLOAD) : { *(.stabstr) }
149 /* DWARF debug sections. */
150 /* Symbols in the DWARF debugging sections are relative to the */
151 /* beginning of the section so we begin them at 0. */
152 /* DWARF 1 */
153 .debug 0 : { *(.debug) }
154 .line 0 : { *(.line) }
155 /* GNU DWARF 1 extensions */
156 .debug_srcinfo 0 : { *(.debug_srcinfo) }
157 .debug_sfnames 0 : { *(.debug_sfnames) }
158 /* DWARF 1.1 and DWARF 2 */
159 .debug_aranges 0 : { *(.debug_aranges) }
160 .debug_pubnames 0 : { *(.debug_pubnames) }
161 /* DWARF 2 */
162 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
163 .debug_abbrev 0 : { *(.debug_abbrev) }
164 .debug_line 0 : { *(.debug_line) }
165 .debug_frame 0 : { *(.debug_frame) }
166 .debug_str 0 : { *(.debug_str) }
167 .debug_loc 0 : { *(.debug_loc) }
168 .debug_macinfo 0 : { *(.debug_macinfo) }
169 /* SGI/MIPS DWARF 2 extensions */
170 .debug_weaknames 0 : { *(.debug_weaknames) }
171 .debug_funcnames 0 : { *(.debug_funcnames) }
172 .debug_typenames 0 : { *(.debug_typenames) }
173 .debug_varnames 0 : { *(.debug_varnames) }
174 /* DWARF 3 */
175 .debug_pubtypes 0 : { *(.debug_pubtypes) }
176 .debug_ranges 0 : { *(.debug_ranges) }
177
178 .note.gnu.arm.ident 0 : { KEEP( *( .note.gnu.arm.ident ) ) }
179 .ARM.attributes 0 : {
180 KEEP( *( .ARM.attributes ) )
181 KEEP( *( .gnu.attributes ) )
182 }
183 /DISCARD/ : { *( .note.GNU-stack ) }
184
185 /* C data can be defined as being in special purpose RAMs using
186 * __attribute__ ((section ("ethram"))) for example. */
187 .usbram (NOLOAD):
188 {
189 *( .usbram )
190 *( .usbram.* )
191 } > UsbRam
192 .ethram (NOLOAD):
193 {
194 *( .ethram )
195 *( .ethram.* )
196 } > EthRam
197 .canram (NOLOAD):
198 {
199 *( .canram )
200 *( .canram.* )
201 } > CanRam
202 .batram (NOLOAD):
203 {
204 *( .batram )
205 *( .batram.* )
206 } > BatRam
207 }