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 = 0xF40
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
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)
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);
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");
60 __cs3_reset = __cs3_reset_cortex_m;
62 /* Make sure we pulled in some reset code. */
63 ASSERT (. != __cs3_reset, "No reset code");
65 *(.text .text.* .gnu.linkonce.t.*)
68 *(.glue_7t) *(.glue_7) *(.vfp11_veneer)
70 *(.rodata .rodata.* .gnu.linkonce.r.*)
72 *(.ARM.extab* .gnu.linkonce.armextab.*)
81 __preinit_array_start = .;
82 KEEP (*(.preinit_array))
83 __preinit_array_end = .;
86 __init_array_start = .;
87 KEEP (*(SORT(.init_array.*)))
92 KEEP (*crtbegin.o(.ctors))
93 KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
94 KEEP (*(SORT(.ctors.*)))
95 KEEP (*crtend.o(.ctors))
101 __fini_array_start = .;
102 KEEP (*(.fini_array))
103 KEEP (*(SORT(.fini_array.*)))
104 __fini_array_end = .;
106 KEEP (*crtbegin.o(.dtors))
107 KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
108 KEEP (*(SORT(.dtors.*)))
109 KEEP (*crtend.o(.dtors))
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)
120 /* .ARM.exidx is sorted, so has to go in its own output section. */
124 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
132 __cs3_region_size_rom = LENGTH(rom);
133 __cs3_region_num = 1;
137 __cs3_region_start_ram = .;
138 *(.cs3.region-head.ram)
142 *(.data .data.* .gnu.linkonce.d.*)
150 *(.bss .bss.* .gnu.linkonce.b.*)
162 .stack (__cs3_stack - __cs3_stack_size) (NOLOAD):
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;
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. */
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) }
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) }
203 .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
204 .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) }
205 /DISCARD/ : { *(.note.GNU-stack) }