]> git.friedersdorff.com Git - max/tmk_keyboard.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC23XX/TOOLCHAIN_GCC_ARM/LPC2368.ld
Merge commit '4d116a04e94cf0d19317d5b44e4fa9f34a3e5594'
[max/tmk_keyboard.git] / tmk_core / tool / mbed / mbed-sdk / libraries / mbed / targets / cmsis / TARGET_NXP / TARGET_LPC23XX / TOOLCHAIN_GCC_ARM / LPC2368.ld
1 OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
2 OUTPUT_ARCH(arm)
3 ENTRY(vectors)
4
5 /* Memory Definitions: */
6 MEMORY
7 {
8     Flash  (rx)  : ORIGIN = 0x00000000, LENGTH = 512k
9     Ram    (rwx) : ORIGIN = 0x40000000, LENGTH = 32k
10     UsbRam (rw)  : ORIGIN = 0x7FD00000, LENGTH = 8k
11     EthRam (rw)  : ORIGIN = 0x7FE00000, LENGTH = 16k
12     CanRam (rw)  : ORIGIN = 0xE0038000, LENGTH = 2k
13     BatRam (rw)  : ORIGIN = 0xE0084000, LENGTH = 2k
14 }
15
16 /* Stack sizes: */
17 UND_Stack_Size = 16;
18 SVC_Stack_Size = 512;
19 ABT_Stack_Size = 16;
20 FIQ_Stack_Size = 16;
21 IRQ_Stack_Size = 256;
22 Stack_Size_Total = UND_Stack_Size + SVC_Stack_Size + ABT_Stack_Size + FIQ_Stack_Size + IRQ_Stack_Size;
23
24 /* Stack tops for each mode: */
25 __und_stack_top__ = __stacks_top__;
26 __abt_stack_top__ = __und_stack_top__ - UND_Stack_Size ;
27 __fiq_stack_top__ = __abt_stack_top__ - ABT_Stack_Size ;
28 __irq_stack_top__ = __fiq_stack_top__ - FIQ_Stack_Size ;
29 __svc_stack_top__ = __irq_stack_top__ - IRQ_Stack_Size ;
30
31 /* C-accessible symbols for memory address ranges: */
32 __FLASH_segment_start__ = ORIGIN( Flash );
33 __FLASH_segment_end__   = ORIGIN( Flash ) + LENGTH( Flash );
34 __SRAM_segment_start__  = ORIGIN( Ram );
35 __SRAM_segment_end__    = ORIGIN( Ram ) + LENGTH( Ram );
36
37 /* Stacks (full descending) at top of RAM, grows downward:
38  *
39  * __stack_min__ is used by the malloc implementation to ensure heap never collides
40  * with stack (assuming stack never grows beyond Stack_Size_Total in length) */
41 __stacks_top__ = __SRAM_segment_end__;
42 __stacks_min__ = __SRAM_segment_end__ - Stack_Size_Total;
43
44 SECTIONS
45 {
46     /* first section is .text which is used for code */
47     __text_start__ = . ;
48     .text : {
49         __privileged_code_start__ = . ;
50         KEEP( *( .vectors ) )
51         *( .privileged_code )
52     
53         __privileged_code_end__ = .;
54
55         *( .text .text.* .gnu.linkonce.t.* )
56         *( .plt )
57         *( .gnu.warning )
58         *( .glue_7t ) *( .glue_7 ) *( .vfp11_veneer )
59         
60         *( .rodata .rodata.* .gnu.linkonce.r.* )
61         
62         *(.ARM.extab* .gnu.linkonce.armextab.*)
63         *(.gcc_except_table)
64         *(.eh_frame_hdr)
65         *(.eh_frame)
66         
67         . = ALIGN( 4 ) ;
68         KEEP( *( .init ) )
69         . = ALIGN( 4 ) ;
70         __preinit_array_start = . ;
71         KEEP( *( .preinit_array ) )
72         __preinit_array_end = . ;
73         . = ALIGN( 4 ) ;
74         __init_array_start = . ;
75         KEEP( *( SORT( .init_array.* ) ) )
76         KEEP( *( .init_array ) )
77         __init_array_end = . ;
78         
79         . = ALIGN( 4 ) ;
80         KEEP( *crtbegin.o( .ctors ) )
81         KEEP( *( EXCLUDE_FILE( *crtend.o ) .ctors ) )
82         KEEP( *( SORT( .ctors.* ) ) )
83         KEEP( *crtend.o( .ctors ) )
84         
85         . = ALIGN( 4 ) ;
86         KEEP( *( .fini ) )
87         . = ALIGN( 4 ) ;
88         __fini_array_start = . ;
89         KEEP( *( .fini_array ) )
90         KEEP( *( SORT( .fini_array.* ) ) )
91         __fini_array_end = . ;
92         
93         KEEP( *crtbegin.o( .dtors ) )
94         KEEP( *( EXCLUDE_FILE( *crtend.o ) .dtors ) )
95         KEEP( *( SORT( .dtors.* ) ) )
96         KEEP( *crtend.o( .dtors ) )
97     
98     } >Flash
99     
100     __exidx_start = . ;
101     .ARM.exidx : {
102         *( .ARM.exidx* .gnu.linkonce.armexidx.* )
103     } >Flash
104     __exidx_end = . ;
105     
106     .text.align : { . = ALIGN( 8 ) ; } >Flash /* Alignment schenanigans */
107     __text_end__ = . ;
108     
109     /* .bss section -- used for uninitialized data */
110     /* Located at the start of RAM */
111     .bss (NOLOAD) : {
112         __bss_start__ = . ;
113         *crt0.o( .ram_vectors )
114         
115         __user_bss_start__ = . ;
116         *( .user_bss )
117         __user_bss_end__ = . ;
118         
119         *( .shbss )
120         *( .bss .bss.* .gnu.linkonce.b.* )
121         *( COMMON )
122         *( .ram.b )
123         . = ALIGN( 8 ) ;
124         
125         __bss_end__ = . ;
126     } >Ram AT>Flash
127
128     /* .data section -- used for initialized data */
129     .data : {
130         __data_start__ = . ;
131         KEEP( *( .jcr ) )
132         *( .got.plt ) *( .got )
133         *( .shdata )
134         *( .data .data.* .gnu.linkonce.d.* )
135         *( .ram )
136         . = ALIGN( 8 ) ;
137         __data_end__ = . ;
138     } >Ram AT>Flash
139
140     __data_init_start__ = LOADADDR( .data ) ;
141
142     /* Heap starts here and grows up in memory */
143     . = ALIGN( 8 ) ;
144     __heap_start__ = . ;
145     end = . ;
146     __end__ = . ;
147
148     .stab    0 (NOLOAD) : { *(.stab) }
149     .stabstr 0 (NOLOAD) : { *(.stabstr) }
150     /* DWARF debug sections. */
151     /* Symbols in the DWARF debugging sections are relative to the  */
152     /* beginning of the section so we begin them at 0.              */
153     /* DWARF 1 */
154     .debug           0 : { *(.debug) }
155     .line            0 : { *(.line) }
156     /* GNU DWARF 1 extensions */
157     .debug_srcinfo   0 : { *(.debug_srcinfo) }
158     .debug_sfnames   0 : { *(.debug_sfnames) }
159     /* DWARF 1.1 and DWARF 2 */
160     .debug_aranges   0 : { *(.debug_aranges) }
161     .debug_pubnames  0 : { *(.debug_pubnames) }
162     /* DWARF 2 */
163     .debug_info      0 : { *(.debug_info .gnu.linkonce.wi.*) }
164     .debug_abbrev    0 : { *(.debug_abbrev) }
165     .debug_line      0 : { *(.debug_line) }
166     .debug_frame     0 : { *(.debug_frame) }
167     .debug_str       0 : { *(.debug_str) }
168     .debug_loc       0 : { *(.debug_loc) }
169     .debug_macinfo   0 : { *(.debug_macinfo) }
170     /* SGI/MIPS DWARF 2 extensions */
171     .debug_weaknames 0 : { *(.debug_weaknames) }
172     .debug_funcnames 0 : { *(.debug_funcnames) }
173     .debug_typenames 0 : { *(.debug_typenames) }
174     .debug_varnames  0 : { *(.debug_varnames) }
175     /* DWARF 3 */
176     .debug_pubtypes  0 : { *(.debug_pubtypes) }
177     .debug_ranges    0 : { *(.debug_ranges) }
178     
179     .note.gnu.arm.ident 0 : { KEEP( *( .note.gnu.arm.ident ) ) }
180     .ARM.attributes     0 : {
181         KEEP( *( .ARM.attributes ) )
182         KEEP( *( .gnu.attributes ) )
183     }
184     /DISCARD/             : { *( .note.GNU-stack ) }
185     
186     /* C data can be defined as being in special purpose RAMs using
187      * __attribute__ ((section ("ethram"))) for example. */
188     .usbram (NOLOAD):
189     {
190         *( .usbram )
191         *( .usbram.* )
192     } > UsbRam
193     .ethram (NOLOAD):
194     {
195         *( .ethram )
196         *( .ethram.* )
197     } > EthRam
198     .canram (NOLOAD):
199     {
200         *( .canram )
201         *( .canram.* )
202     } > CanRam
203     .batram (NOLOAD):
204     {
205         *( .batram )
206         *( .batram.* )
207     } > BatRam
208 }