1 /* Linker script for mbed LPC1768
3 * Version:CodeSourcery Sourcery G++ Lite 2007q3-53
4 * BugURL:https://support.codesourcery.com/GNUToolchain/
6 * Copyright 2007 CodeSourcery.
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
17 OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
18 ENTRY(__cs3_reset_cortex_m)
22 ram ORIGIN: 8_byte_aligned(49 vect * 4 bytes) = 8_byte_aligned(0xC4) = 0xC8
23 ram LENGTH: 32KB - 0xC8 = 0x7F38
27 rom (rx) : ORIGIN = 0x00000000, LENGTH = 512K
29 ram (rwx) : ORIGIN = 0x100000C8, LENGTH = 0x7F38
31 ram1(rwx) : ORIGIN = 0x2007C000, LENGTH = 16K
32 ram2(rwx) : ORIGIN = 0x20080000, LENGTH = 16K
35 /* These force the linker to search for particular symbols from
36 * the start of the link process and thus ensure the user's
37 * overrides are picked up
39 EXTERN(__cs3_reset_cortex_m)
40 EXTERN(__cs3_interrupt_vector_cortex_m)
41 EXTERN(__cs3_start_c main __cs3_stack __cs3_stack_size __cs3_heap_end)
43 PROVIDE(__cs3_stack = __cs3_region_start_ram + __cs3_region_size_ram);
44 PROVIDE(__cs3_stack_size = __cs3_region_start_ram + __cs3_region_size_ram - _end);
45 PROVIDE(__cs3_heap_start = _end);
46 PROVIDE(__cs3_heap_end = __cs3_region_start_ram + __cs3_region_size_ram);
53 __cs3_region_start_rom = .;
54 *(.cs3.region-head.rom)
55 __cs3_interrupt_vector = __cs3_interrupt_vector_cortex_m;
56 *(.cs3.interrupt_vector)
57 /* Make sure we pulled in an interrupt vector. */
58 ASSERT (. != __cs3_interrupt_vector_cortex_m, "No interrupt vector");
62 __cs3_reset = __cs3_reset_cortex_m;
64 /* Make sure we pulled in some reset code. */
65 ASSERT (. != __cs3_reset, "No reset code");
67 *(.text .text.* .gnu.linkonce.t.*)
70 *(.glue_7t) *(.glue_7) *(.vfp11_veneer)
72 *(.rodata .rodata.* .gnu.linkonce.r.*)
74 *(.ARM.extab* .gnu.linkonce.armextab.*)
83 __preinit_array_start = .;
84 KEEP (*(.preinit_array))
85 __preinit_array_end = .;
88 __init_array_start = .;
89 KEEP (*(SORT(.init_array.*)))
94 KEEP (*crtbegin.o(.ctors))
95 KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
96 KEEP (*(SORT(.ctors.*)))
97 KEEP (*crtend.o(.ctors))
103 __fini_array_start = .;
104 KEEP (*(.fini_array))
105 KEEP (*(SORT(.fini_array.*)))
106 __fini_array_end = .;
108 KEEP (*crtbegin.o(.dtors))
109 KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
110 KEEP (*(SORT(.dtors.*)))
111 KEEP (*crtend.o(.dtors))
116 LONG (__cs3_region_init_ram)
117 LONG (__cs3_region_start_ram)
118 LONG (__cs3_region_init_size_ram)
119 LONG (__cs3_region_zero_size_ram)
122 /* .ARM.exidx is sorted, so has to go in its own output section. */
126 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
134 __cs3_region_size_rom = LENGTH(rom);
135 __cs3_region_num = 1;
139 __cs3_region_start_ram = .;
140 *(.cs3.region-head.ram)
144 *(.data .data.* .gnu.linkonce.d.*)
152 *(.bss .bss.* .gnu.linkonce.b.*)
159 /* This used for USB RAM section */
168 .stack (__cs3_stack - __cs3_stack_size) (NOLOAD):
175 __cs3_region_init_ram = LOADADDR (.data);
176 __cs3_region_init_size_ram = _edata - __cs3_region_start_ram;
177 __cs3_region_zero_size_ram = _end - _edata;
178 __cs3_region_size_ram = LENGTH(ram);
179 __cs3_region_num = 1;
181 .stab 0 (NOLOAD) : { *(.stab) }
182 .stabstr 0 (NOLOAD) : { *(.stabstr) }
183 /* DWARF debug sections.
184 * Symbols in the DWARF debugging sections are relative to the beginning
185 * of the section so we begin them at 0. */
187 .debug 0 : { *(.debug) }
188 .line 0 : { *(.line) }
189 /* GNU DWARF 1 extensions */
190 .debug_srcinfo 0 : { *(.debug_srcinfo) }
191 .debug_sfnames 0 : { *(.debug_sfnames) }
192 /* DWARF 1.1 and DWARF 2 */
193 .debug_aranges 0 : { *(.debug_aranges) }
194 .debug_pubnames 0 : { *(.debug_pubnames) }
196 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
197 .debug_abbrev 0 : { *(.debug_abbrev) }
198 .debug_line 0 : { *(.debug_line) }
199 .debug_frame 0 : { *(.debug_frame) }
200 .debug_str 0 : { *(.debug_str) }
201 .debug_loc 0 : { *(.debug_loc) }
202 .debug_macinfo 0 : { *(.debug_macinfo) }
203 /* SGI/MIPS DWARF 2 extensions */
204 .debug_weaknames 0 : { *(.debug_weaknames) }
205 .debug_funcnames 0 : { *(.debug_funcnames) }
206 .debug_typenames 0 : { *(.debug_typenames) }
207 .debug_varnames 0 : { *(.debug_varnames) }
209 .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
210 .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) }
211 /DISCARD/ : { *(.note.GNU-stack) }