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
18 OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
19 ENTRY(__cs3_reset_cortex_m)
23 ram ORIGIN: 8_byte_aligned(48 vect * 4 bytes) = 8_byte_aligned(0xC0) = 0xC0
24 ram LENGTH: 8KB - 0xC0 = 0xF40
28 rom (rx) : ORIGIN = 0x00000000, LENGTH = 32K
30 ram (rwx) : ORIGIN = 0x100000C0, LENGTH = 0x1F40
31 usb_ram (rwx) : ORIGIN = 0x20004000, LENGTH = 0x800
34 /* These force the linker to search for particular symbols from
35 * the start of the link process and thus ensure the user's
36 * overrides are picked up
38 EXTERN(__cs3_reset_cortex_m)
39 EXTERN(__cs3_interrupt_vector_cortex_m)
40 EXTERN(__cs3_start_c main __cs3_stack __cs3_stack_size __cs3_heap_end)
42 PROVIDE(__cs3_stack = __cs3_region_start_ram + __cs3_region_size_ram);
43 PROVIDE(__cs3_stack_size = __cs3_region_start_ram + __cs3_region_size_ram - _end);
44 PROVIDE(__cs3_heap_start = _end);
45 PROVIDE(__cs3_heap_end = __cs3_region_start_ram + __cs3_region_size_ram);
52 __cs3_region_start_rom = .;
53 *(.cs3.region-head.rom)
54 __cs3_interrupt_vector = __cs3_interrupt_vector_cortex_m;
55 *(.cs3.interrupt_vector)
56 /* Make sure we pulled in an interrupt vector. */
57 ASSERT (. != __cs3_interrupt_vector_cortex_m, "No interrupt vector");
61 __cs3_reset = __cs3_reset_cortex_m;
63 /* Make sure we pulled in some reset code. */
64 ASSERT (. != __cs3_reset, "No reset code");
66 *(.text .text.* .gnu.linkonce.t.*)
69 *(.glue_7t) *(.glue_7) *(.vfp11_veneer)
71 *(.rodata .rodata.* .gnu.linkonce.r.*)
73 *(.ARM.extab* .gnu.linkonce.armextab.*)
82 __preinit_array_start = .;
83 KEEP (*(.preinit_array))
84 __preinit_array_end = .;
87 __init_array_start = .;
88 KEEP (*(SORT(.init_array.*)))
93 KEEP (*crtbegin.o(.ctors))
94 KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
95 KEEP (*(SORT(.ctors.*)))
96 KEEP (*crtend.o(.ctors))
102 __fini_array_start = .;
103 KEEP (*(.fini_array))
104 KEEP (*(SORT(.fini_array.*)))
105 __fini_array_end = .;
107 KEEP (*crtbegin.o(.dtors))
108 KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
109 KEEP (*(SORT(.dtors.*)))
110 KEEP (*crtend.o(.dtors))
115 LONG (__cs3_region_init_ram)
116 LONG (__cs3_region_start_ram)
117 LONG (__cs3_region_init_size_ram)
118 LONG (__cs3_region_zero_size_ram)
121 /* .ARM.exidx is sorted, so has to go in its own output section. */
125 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
133 __cs3_region_size_rom = LENGTH(rom);
134 __cs3_region_num = 1;
138 __cs3_region_start_ram = .;
139 *(.cs3.region-head.ram)
143 *(.data .data.* .gnu.linkonce.d.*)
151 *(.bss .bss.* .gnu.linkonce.b.*)
163 .stack (__cs3_stack - __cs3_stack_size) (NOLOAD):
170 __cs3_region_init_ram = LOADADDR (.data);
171 __cs3_region_init_size_ram = _edata - __cs3_region_start_ram;
172 __cs3_region_zero_size_ram = _end - _edata;
173 __cs3_region_size_ram = LENGTH(ram);
174 __cs3_region_num = 1;
176 .stab 0 (NOLOAD) : { *(.stab) }
177 .stabstr 0 (NOLOAD) : { *(.stabstr) }
178 /* DWARF debug sections.
179 * Symbols in the DWARF debugging sections are relative to the beginning
180 * of the section so we begin them at 0. */
182 .debug 0 : { *(.debug) }
183 .line 0 : { *(.line) }
184 /* GNU DWARF 1 extensions */
185 .debug_srcinfo 0 : { *(.debug_srcinfo) }
186 .debug_sfnames 0 : { *(.debug_sfnames) }
187 /* DWARF 1.1 and DWARF 2 */
188 .debug_aranges 0 : { *(.debug_aranges) }
189 .debug_pubnames 0 : { *(.debug_pubnames) }
191 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
192 .debug_abbrev 0 : { *(.debug_abbrev) }
193 .debug_line 0 : { *(.debug_line) }
194 .debug_frame 0 : { *(.debug_frame) }
195 .debug_str 0 : { *(.debug_str) }
196 .debug_loc 0 : { *(.debug_loc) }
197 .debug_macinfo 0 : { *(.debug_macinfo) }
198 /* SGI/MIPS DWARF 2 extensions */
199 .debug_weaknames 0 : { *(.debug_weaknames) }
200 .debug_funcnames 0 : { *(.debug_funcnames) }
201 .debug_typenames 0 : { *(.debug_typenames) }
202 .debug_varnames 0 : { *(.debug_varnames) }
204 .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
205 .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) }
206 /DISCARD/ : { *(.note.GNU-stack) }