Update to new build system.
[clinton/Smoothieware.git] / mbed / src / vendor / NXP / cmsis / LPC11U24 / GCC_CS / LPC11U24.ld
1 /* Linker script for mbed LPC1768
2 *
3 * Version:CodeSourcery Sourcery G++ Lite 2007q3-53
4 * BugURL:https://support.codesourcery.com/GNUToolchain/
5 *
6 * Copyright 2007 CodeSourcery.
7 *
8 * The authors hereby grant permission to use, copy, modify, distribute,
9 * and license this software and its documentation for any purpose, provided
10 * that existing copyright notices are retained in all copies and that this
11 * notice is included verbatim in any distributions. No written agreement,
12 * license, or royalty fee is required for any of the authorized uses.
13 * Modifications to this software may be copyrighted by their authors
14 * and need not follow the licensing terms described here, provided that
15 * the new terms are clearly indicated on the first page of each file where
16 * they apply. */
17
18 OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
19 ENTRY(__cs3_reset_cortex_m)
20 SEARCH_DIR(.)
21
22 /*
23 ram ORIGIN: 8_byte_aligned(48 vect * 4 bytes) = 8_byte_aligned(0xC0) = 0xC0
24 ram LENGTH: 8KB - 0xC0 = 0xF40
25 */
26 MEMORY
27 {
28 rom (rx) : ORIGIN = 0x00000000, LENGTH = 32K
29
30 ram (rwx) : ORIGIN = 0x100000C0, LENGTH = 0xF40
31 }
32
33 /* These force the linker to search for particular symbols from
34 * the start of the link process and thus ensure the user's
35 * overrides are picked up
36 */
37 EXTERN(__cs3_reset_cortex_m)
38 EXTERN(__cs3_interrupt_vector_cortex_m)
39 EXTERN(__cs3_start_c main __cs3_stack __cs3_stack_size __cs3_heap_end)
40
41 PROVIDE(__cs3_stack = __cs3_region_start_ram + __cs3_region_size_ram);
42 PROVIDE(__cs3_stack_size = __cs3_region_start_ram + __cs3_region_size_ram - _end);
43 PROVIDE(__cs3_heap_start = _end);
44 PROVIDE(__cs3_heap_end = __cs3_region_start_ram + __cs3_region_size_ram);
45
46 SECTIONS
47 {
48 .text :
49 {
50 CREATE_OBJECT_SYMBOLS
51 __cs3_region_start_rom = .;
52 *(.cs3.region-head.rom)
53 __cs3_interrupt_vector = __cs3_interrupt_vector_cortex_m;
54 *(.cs3.interrupt_vector)
55 /* Make sure we pulled in an interrupt vector. */
56 ASSERT (. != __cs3_interrupt_vector_cortex_m, "No interrupt vector");
57 *(.rom)
58 *(.rom.b)
59
60 __cs3_reset = __cs3_reset_cortex_m;
61 *(.cs3.reset)
62 /* Make sure we pulled in some reset code. */
63 ASSERT (. != __cs3_reset, "No reset code");
64
65 *(.text .text.* .gnu.linkonce.t.*)
66 *(.plt)
67 *(.gnu.warning)
68 *(.glue_7t) *(.glue_7) *(.vfp11_veneer)
69
70 *(.rodata .rodata.* .gnu.linkonce.r.*)
71
72 *(.ARM.extab* .gnu.linkonce.armextab.*)
73 *(.gcc_except_table)
74 *(.eh_frame_hdr)
75 *(.eh_frame)
76
77 . = ALIGN(4);
78 KEEP(*(.init))
79
80 . = ALIGN(4);
81 __preinit_array_start = .;
82 KEEP (*(.preinit_array))
83 __preinit_array_end = .;
84
85 . = ALIGN(4);
86 __init_array_start = .;
87 KEEP (*(SORT(.init_array.*)))
88 KEEP (*(.init_array))
89 __init_array_end = .;
90
91 . = ALIGN(0x4);
92 KEEP (*crtbegin.o(.ctors))
93 KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
94 KEEP (*(SORT(.ctors.*)))
95 KEEP (*crtend.o(.ctors))
96
97 . = ALIGN(4);
98 KEEP(*(.fini))
99
100 . = ALIGN(4);
101 __fini_array_start = .;
102 KEEP (*(.fini_array))
103 KEEP (*(SORT(.fini_array.*)))
104 __fini_array_end = .;
105
106 KEEP (*crtbegin.o(.dtors))
107 KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
108 KEEP (*(SORT(.dtors.*)))
109 KEEP (*crtend.o(.dtors))
110
111 . = ALIGN(4);
112 __cs3_regions = .;
113 LONG (0)
114 LONG (__cs3_region_init_ram)
115 LONG (__cs3_region_start_ram)
116 LONG (__cs3_region_init_size_ram)
117 LONG (__cs3_region_zero_size_ram)
118 }
119
120 /* .ARM.exidx is sorted, so has to go in its own output section. */
121 __exidx_start = .;
122 .ARM.exidx :
123 {
124 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
125 } >rom
126 __exidx_end = .;
127 .text.align :
128 {
129 . = ALIGN(8);
130 _etext = .;
131 } >rom
132 __cs3_region_size_rom = LENGTH(rom);
133 __cs3_region_num = 1;
134
135 .data :
136 {
137 __cs3_region_start_ram = .;
138 *(.cs3.region-head.ram)
139 KEEP(*(.jcr))
140 *(.got.plt) *(.got)
141 *(.shdata)
142 *(.data .data.* .gnu.linkonce.d.*)
143 *(.ram)
144 . = ALIGN (8);
145 _edata = .;
146 } >ram AT>rom
147 .bss :
148 {
149 *(.shbss)
150 *(.bss .bss.* .gnu.linkonce.b.*)
151 *(COMMON)
152 *(.ram.b)
153 . = ALIGN (8);
154 _end = .;
155 __end = .;
156 } >ram AT>rom
157
158 .heap (NOLOAD) :
159 {
160 *(.heap)
161 } >ram
162 .stack (__cs3_stack - __cs3_stack_size) (NOLOAD):
163 {
164 *(.stack)
165 _estack = .;
166 PROVIDE(estack = .);
167 } >ram
168
169 __cs3_region_init_ram = LOADADDR (.data);
170 __cs3_region_init_size_ram = _edata - __cs3_region_start_ram;
171 __cs3_region_zero_size_ram = _end - _edata;
172 __cs3_region_size_ram = LENGTH(ram);
173 __cs3_region_num = 1;
174
175 .stab 0 (NOLOAD) : { *(.stab) }
176 .stabstr 0 (NOLOAD) : { *(.stabstr) }
177 /* DWARF debug sections.
178 * Symbols in the DWARF debugging sections are relative to the beginning
179 * of the section so we begin them at 0. */
180 /* DWARF 1 */
181 .debug 0 : { *(.debug) }
182 .line 0 : { *(.line) }
183 /* GNU DWARF 1 extensions */
184 .debug_srcinfo 0 : { *(.debug_srcinfo) }
185 .debug_sfnames 0 : { *(.debug_sfnames) }
186 /* DWARF 1.1 and DWARF 2 */
187 .debug_aranges 0 : { *(.debug_aranges) }
188 .debug_pubnames 0 : { *(.debug_pubnames) }
189 /* DWARF 2 */
190 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
191 .debug_abbrev 0 : { *(.debug_abbrev) }
192 .debug_line 0 : { *(.debug_line) }
193 .debug_frame 0 : { *(.debug_frame) }
194 .debug_str 0 : { *(.debug_str) }
195 .debug_loc 0 : { *(.debug_loc) }
196 .debug_macinfo 0 : { *(.debug_macinfo) }
197 /* SGI/MIPS DWARF 2 extensions */
198 .debug_weaknames 0 : { *(.debug_weaknames) }
199 .debug_funcnames 0 : { *(.debug_funcnames) }
200 .debug_typenames 0 : { *(.debug_typenames) }
201 .debug_varnames 0 : { *(.debug_varnames) }
202
203 .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
204 .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) }
205 /DISCARD/ : { *(.note.GNU-stack) }
206 }