]> git.donarmstrong.com Git - qmk_firmware.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC11XX_11CXX/TOOLCHAIN_GCC_ARM/TARGET_LPC11CXX/LPC11C24.ld
Merge commit '1fe4406f374291ab2e86e95a97341fd9c475fcb8'
[qmk_firmware.git] / tmk_core / tool / mbed / mbed-sdk / libraries / mbed / targets / cmsis / TARGET_NXP / TARGET_LPC11XX_11CXX / TOOLCHAIN_GCC_ARM / TARGET_LPC11CXX / LPC11C24.ld
1 /* Linker script for mbed LPC1114 */
2
3 /* Linker script to configure memory regions. */
4 MEMORY
5 {
6   FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 32K
7   RAM (rwx) :  ORIGIN = 0x100000C0, LENGTH = 0x1F40
8 }
9
10 /* Linker script to place sections and symbol values. Should be used together
11  * with other linker script that defines memory regions FLASH and RAM.
12  * It references following symbols, which must be defined in code:
13  *   Reset_Handler : Entry of reset handler
14  * 
15  * It defines following symbols, which code can use without definition:
16  *   __exidx_start
17  *   __exidx_end
18  *   __etext
19  *   __data_start__
20  *   __preinit_array_start
21  *   __preinit_array_end
22  *   __init_array_start
23  *   __init_array_end
24  *   __fini_array_start
25  *   __fini_array_end
26  *   __data_end__
27  *   __bss_start__
28  *   __bss_end__
29  *   __end__
30  *   end
31  *   __HeapLimit
32  *   __StackLimit
33  *   __StackTop
34  *   __stack
35  */
36 ENTRY(Reset_Handler)
37
38 SECTIONS
39 {
40     .text :
41     {
42         KEEP(*(.isr_vector))
43                 *(.text.Reset_Handler)
44         *(.text.SystemInit)
45                 . = 0x200;
46         *(.text*)
47
48         KEEP(*(.init))
49         KEEP(*(.fini))
50
51         /* .ctors */
52         *crtbegin.o(.ctors)
53         *crtbegin?.o(.ctors)
54         *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
55         *(SORT(.ctors.*))
56         *(.ctors)
57
58         /* .dtors */
59         *crtbegin.o(.dtors)
60         *crtbegin?.o(.dtors)
61         *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
62         *(SORT(.dtors.*))
63         *(.dtors)
64
65         *(.rodata*)
66
67         KEEP(*(.eh_frame*))
68     } > FLASH
69
70     .ARM.extab : 
71     {
72         *(.ARM.extab* .gnu.linkonce.armextab.*)
73     } > FLASH
74
75     __exidx_start = .;
76     .ARM.exidx :
77     {
78         *(.ARM.exidx* .gnu.linkonce.armexidx.*)
79     } > FLASH
80     __exidx_end = .;
81
82     __etext = .;
83         
84     .data : AT (__etext)
85     {
86         __data_start__ = .;
87         *(vtable)
88         *(.data*)
89
90         . = ALIGN(4);
91         /* preinit data */
92         PROVIDE (__preinit_array_start = .);
93         KEEP(*(.preinit_array))
94         PROVIDE (__preinit_array_end = .);
95
96         . = ALIGN(4);
97         /* init data */
98         PROVIDE (__init_array_start = .);
99         KEEP(*(SORT(.init_array.*)))
100         KEEP(*(.init_array))
101         PROVIDE (__init_array_end = .);
102
103
104         . = ALIGN(4);
105         /* finit data */
106         PROVIDE (__fini_array_start = .);
107         KEEP(*(SORT(.fini_array.*)))
108         KEEP(*(.fini_array))
109         PROVIDE (__fini_array_end = .);
110
111         . = ALIGN(4);
112         /* All data end */
113         __data_end__ = .;
114
115     } > RAM
116
117     .bss :
118     {
119         __bss_start__ = .;
120         *(.bss*)
121         *(COMMON)
122         __bss_end__ = .;
123     } > RAM
124     
125     .heap :
126     {
127         __end__ = .;
128         end = __end__;
129         *(.heap*)
130         __HeapLimit = .;
131     } > RAM
132
133     /* .stack_dummy section doesn't contains any symbols. It is only
134      * used for linker to calculate size of stack sections, and assign
135      * values to stack symbols later */
136     .stack_dummy :
137     {
138         *(.stack)
139     } > RAM
140
141     /* Set stack top to end of RAM, and stack limit move down by
142      * size of stack_dummy section */
143     __StackTop = ORIGIN(RAM) + LENGTH(RAM);
144     __StackLimit = __StackTop - SIZEOF(.stack_dummy);
145     PROVIDE(__stack = __StackTop);
146     
147     /* Check if data + heap + stack exceeds RAM limit */
148     ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
149 }