1 /*Copyright (C) 2011 by Sagar G V, Thejasvi M V
3 Permission is hereby granted, free of charge, to any person obtaining a copy
4 of this software and associated documentation files (the "Software"), to deal
5 in the Software without restriction, including without limitation the rights
6 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 copies of the Software, and to permit persons to whom the Software is
8 furnished to do so, subject to the following conditions:
10 The above copyright notice and this permission notice shall be included in
11 all copies or substantial portions of the Software.
13 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 Arthur Wolf & Adam Green in 2011 - Updated to work with mbed.
25 OUTPUT_FORMAT ("elf32-littlearm")
31 /* LPC1768 : 512k ROM + 64k SRAM */
32 /*------------------------------ */
34 /* On-chip ROM is a readable (r), executable region (x) */
35 /* On-chip SRAM is a readable (r), writable (w) and */
36 /* executable region (x) */
38 /* Main ROM region - 512k for LPC1768 */
39 IROM (rx) : ORIGIN = 0x00000000, LENGTH = 512k
41 /* local static RAM - 32k for LPC1768 */
42 IRAM0 (rwx) : ORIGIN = 0x10000000, LENGTH = 32k
44 /* AHB SRAM - 16k for LPC1768 - often used for USB */
45 IRAM1 (rwx) : ORIGIN = 0x2007C000, LENGTH = 16k
46 IRAM2 (rwx) : ORIGIN = 0x20080000, LENGTH = 16k
49 /* SECTION command : Define mapping of input sections */
50 /* into output sections. */
54 /******************************************/
73 __preinit_array_start = .;
74 KEEP (*(.preinit_array))
75 __preinit_array_end = .;
78 __init_array_start = .;
79 KEEP (*(SORT(.init_array.*)))
84 KEEP (*crtbegin.o(.ctors))
85 KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
86 KEEP (*(SORT(.ctors.*)))
87 KEEP (*crtend.o(.ctors))
93 __fini_array_start = .;
95 KEEP (*(SORT(.fini_array.*)))
100 KEEP (*crtbegin.o(.dtors))
101 KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
102 KEEP (*(SORT(.dtors.*)))
103 KEEP (*crtend.o(.dtors))
105 /* End Of .text section */
114 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
118 /**************************************************/
119 /* fastcode - copied at startup & executed in RAM */
126 *(.glue_7t) *(.glue_7)
129 /* add other modules here ... */
136 /******************************************/
137 /* This used for USB RAM section */
143 /******************************************/
147 _sidata = LOADADDR (.data);
151 *(.ARM.__AT_0x10000000)
160 /******************************************/
161 /* For no-init variables section */
175 /******************************************/
176 /* For stack section */
177 .stackarea (NOLOAD) :
182 *(.stackarea .stackarea.*)
191 _stack = ORIGIN(IRAM0) + LENGTH(IRAM0);
194 /******************************************/
195 /* Stabs debugging sections. */
196 .stab 0 : { *(.stab) }
197 .stabstr 0 : { *(.stabstr) }
198 .stab.excl 0 : { *(.stab.excl) }
199 .stab.exclstr 0 : { *(.stab.exclstr) }
200 .stab.index 0 : { *(.stab.index) }
201 .stab.indexstr 0 : { *(.stab.indexstr) }
202 /* .comment 0 : { *(.comment) } */
203 /* DWARF debug sections.
204 Symbols in the DWARF debugging sections are relative to the beginning
205 of the section so we begin them at 0. */
207 .debug 0 : { *(.debug) }
208 .line 0 : { *(.line) }
209 /* GNU DWARF 1 extensions */
210 .debug_srcinfo 0 : { *(.debug_srcinfo) }
211 .debug_sfnames 0 : { *(.debug_sfnames) }
212 /* DWARF 1.1 and DWARF 2 */
213 .debug_aranges 0 : { *(.debug_aranges) }
214 .debug_pubnames 0 : { *(.debug_pubnames) }
216 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
217 .debug_abbrev 0 : { *(.debug_abbrev) }
218 .debug_line 0 : { *(.debug_line) }
219 .debug_frame 0 : { *(.debug_frame) }
220 .debug_str 0 : { *(.debug_str) }
221 .debug_loc 0 : { *(.debug_loc) }
222 .debug_macinfo 0 : { *(.debug_macinfo) }
223 /* SGI/MIPS DWARF 2 extensions */
224 .debug_weaknames 0 : { *(.debug_weaknames) }
225 .debug_funcnames 0 : { *(.debug_funcnames) }
226 .debug_typenames 0 : { *(.debug_typenames) }
227 .debug_varnames 0 : { *(.debug_varnames) }
229 /* TODO: Figure out how to properly deal with these. It looks like RealView might expect this symbol to come from
230 the main program and not mbed.ar These inline virtual methods provided by base classes end up having code
231 created for them by the class that use them (ie. LocalFileSystem instantiates code for
232 FileSystemLike::rename but doesn't instantiate the debug_frame)
234 PROVIDE (__ARM_grp_.debug_frame$i._ZN4mbed14FileSystemLike6renameEPKcS2_ = 0xBAADF00D);
235 PROVIDE (__ARM_grp_.debug_frame$i._ZN4mbed10DigitalOut5writeEi = 0xBAADF00D);
236 PROVIDE (__ARM_grp_.debug_frame$$$i._ZN4mbed14FileSystemLike6renameEPKcS2_$i._ZN4mbed14FileSystemLike6renameEPKcS2_ = 0xBAADF00D);
237 PROVIDE (__ARM_grp_.debug_frame$i._ZN4mbed14FileSystemLike5mkdirEPKci = 0xBAADF00D);