]> git.donarmstrong.com Git - qmk_firmware.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC176X/TOOLCHAIN_GCC_CS/LPC1768.ld
Merge commit '1fe4406f374291ab2e86e95a97341fd9c475fcb8'
[qmk_firmware.git] / tmk_core / tool / mbed / mbed-sdk / libraries / mbed / targets / cmsis / TARGET_NXP / TARGET_LPC176X / TOOLCHAIN_GCC_CS / LPC1768.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 OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
18 ENTRY(__cs3_reset_cortex_m)
19 SEARCH_DIR(.)
20
21 /*
22 ram ORIGIN: 8_byte_aligned(49 vect * 4 bytes) =  8_byte_aligned(0xC4) = 0xC8
23 ram LENGTH: 32KB - 0xC8 = 0x7F38
24 */
25 MEMORY
26 {
27   rom (rx)  : ORIGIN = 0x00000000, LENGTH = 512K
28   
29   ram (rwx) : ORIGIN = 0x100000C8, LENGTH = 0x7F38
30   
31   ram1(rwx) : ORIGIN = 0x2007C000, LENGTH = 16K
32   ram2(rwx) : ORIGIN = 0x20080000, LENGTH = 16K
33 }
34
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
38  */
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)
42
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);
47
48 SECTIONS
49 {
50   .text :
51   {
52     CREATE_OBJECT_SYMBOLS
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");
59     *(.rom)
60     *(.rom.b)
61
62     __cs3_reset = __cs3_reset_cortex_m;
63     *(.cs3.reset)
64     /* Make sure we pulled in some reset code.  */
65     ASSERT (. != __cs3_reset, "No reset code");
66
67     *(.text .text.* .gnu.linkonce.t.*)
68     *(.plt)
69     *(.gnu.warning)
70     *(.glue_7t) *(.glue_7) *(.vfp11_veneer)
71
72     *(.rodata .rodata.* .gnu.linkonce.r.*)
73
74     *(.ARM.extab* .gnu.linkonce.armextab.*)
75     *(.gcc_except_table)
76     *(.eh_frame_hdr)
77     *(.eh_frame)
78
79     . = ALIGN(4);
80     KEEP(*(.init))
81
82     . = ALIGN(4);
83     __preinit_array_start = .;
84     KEEP (*(.preinit_array))
85     __preinit_array_end = .;
86
87     . = ALIGN(4);
88     __init_array_start = .;
89     KEEP (*(SORT(.init_array.*)))
90     KEEP (*(.init_array))
91     __init_array_end = .;
92
93     . = ALIGN(0x4);
94     KEEP (*crtbegin.o(.ctors))
95     KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
96     KEEP (*(SORT(.ctors.*)))
97     KEEP (*crtend.o(.ctors))
98
99     . = ALIGN(4);
100     KEEP(*(.fini))
101
102     . = ALIGN(4);
103     __fini_array_start = .;
104     KEEP (*(.fini_array))
105     KEEP (*(SORT(.fini_array.*)))
106     __fini_array_end = .;
107
108     KEEP (*crtbegin.o(.dtors))
109     KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
110     KEEP (*(SORT(.dtors.*)))
111     KEEP (*crtend.o(.dtors))
112
113     . = ALIGN(4);
114     __cs3_regions = .;
115     LONG (0)
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)
120   }
121
122   /* .ARM.exidx is sorted, so has to go in its own output section.  */
123   __exidx_start = .;
124   .ARM.exidx :
125   {
126     *(.ARM.exidx* .gnu.linkonce.armexidx.*)
127   } >rom
128   __exidx_end = .;
129   .text.align :
130   {
131     . = ALIGN(8);
132     _etext = .;
133   } >rom
134   __cs3_region_size_rom = LENGTH(rom);
135   __cs3_region_num = 1;
136   
137   .data :
138   {
139     __cs3_region_start_ram = .;
140     *(.cs3.region-head.ram)
141     KEEP(*(.jcr))
142     *(.got.plt) *(.got)
143     *(.shdata)
144     *(.data .data.* .gnu.linkonce.d.*)
145     *(.ram)
146     . = ALIGN (8);
147     _edata = .;
148   } >ram AT>rom
149   .bss :
150   {
151     *(.shbss)
152     *(.bss .bss.* .gnu.linkonce.b.*)
153     *(COMMON)
154     *(.ram.b)
155     . = ALIGN (8);
156     _end = .;
157     __end = .;
158   } >ram AT>rom
159   /* This used for USB RAM section */
160         .usb_ram (NOLOAD):
161         {
162                 *.o (USB_RAM)
163         } > ram2
164   .heap (NOLOAD) :
165   {
166     *(.heap)
167   } >ram
168   .stack (__cs3_stack - __cs3_stack_size) (NOLOAD):
169   {
170     *(.stack)
171     _estack = .;
172     PROVIDE(estack = .);
173   } >ram
174
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;
180
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.  */
186   /* DWARF 1 */
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) }
195   /* DWARF 2 */
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) }
208
209   .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
210   .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) }
211   /DISCARD/ : { *(.note.GNU-stack) }
212 }