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