]> git.donarmstrong.com Git - qmk_firmware.git/blob - tool/mbed/mbed-sdk/libraries/mbed/targets/cmsis/TARGET_Maxim/TARGET_MAX32600/TOOLCHAIN_GCC_ARM/max32600.ld
Squashed 'tmk_core/' changes from 7967731..b9e0ea0
[qmk_firmware.git] / tool / mbed / mbed-sdk / libraries / mbed / targets / cmsis / TARGET_Maxim / TARGET_MAX32600 / TOOLCHAIN_GCC_ARM / max32600.ld
1 /*******************************************************************************
2  * Copyright (C) 2015 Maxim Integrated Products, Inc., All Rights Reserved.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  * and/or sell copies of the Software, and to permit persons to whom the
9  * Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included
12  * in all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17  * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
18  * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20  * OTHER DEALINGS IN THE SOFTWARE.
21  *
22  * Except as contained in this notice, the name of Maxim Integrated
23  * Products, Inc. shall not be used except as stated in the Maxim Integrated
24  * Products, Inc. Branding Policy.
25  *
26  * The mere transfer of this software does not imply any licenses
27  * of trade secrets, proprietary technology, copyrights, patents,
28  * trademarks, maskwork rights, or any other form of intellectual
29  * property whatsoever. Maxim Integrated Products, Inc. retains all
30  * ownership rights.
31  *******************************************************************************
32  */
33  
34 /******************************************************************************
35  *
36  * Linker configuration file, default ARM Cortex M3 produced by Maxim Integrated Inc.
37  *
38  *****************************************************************************/
39
40 MEMORY
41 {
42     FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000 /* start from 0x0, fullsize flash, 256k */
43     RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000 /* full-size SRAM, 32k */
44 }
45
46 /* Linker script to place sections and symbol values. Should be used together
47  * with other linker script that defines memory regions FLASH and RAM.
48  * It references following symbols, which must be defined in code:
49  *   Reset_Handler : Entry of reset handler
50  * 
51  * It defines following symbols, which code can use without definition:
52  *   __exidx_start
53  *   __exidx_end
54  *   __etext
55  *   __data_start__
56  *   __preinit_array_start
57  *   __preinit_array_end
58  *   __init_array_start
59  *   __init_array_end
60  *   __fini_array_start
61  *   __fini_array_end
62  *   __data_end__
63  *   __bss_start__
64  *   __bss_end__
65  *   __end__
66  *   end
67  *   __HeapLimit
68  *   __StackLimit
69  *   __StackTop
70  *   __stack
71  */
72 ENTRY(Reset_Handler)
73
74 SECTIONS
75 {
76     .text :
77     {
78         KEEP(*(.isr_vector))
79         *(.text*)
80
81         KEEP(*(.init))
82         KEEP(*(.fini))
83
84         /* .ctors */
85         *crtbegin.o(.ctors)
86         *crtbegin?.o(.ctors)
87         *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
88         *(SORT(.ctors.*))
89         *(.ctors)
90
91         /* .dtors */
92         *crtbegin.o(.dtors)
93         *crtbegin?.o(.dtors)
94         *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
95         *(SORT(.dtors.*))
96         *(.dtors)
97
98         *(.rodata*)
99
100         KEEP(*(.eh_frame*))
101     } > FLASH
102
103     .ARM.extab :
104     {
105         *(.ARM.extab* .gnu.linkonce.armextab.*)
106     } > FLASH
107
108     __exidx_start = .;
109     .ARM.exidx :
110     {
111         *(.ARM.exidx* .gnu.linkonce.armexidx.*)
112     } > FLASH
113     __exidx_end = .;
114
115     __etext = .;
116
117     .data : AT (__etext)
118     {
119         __data_start__ = .;
120         *(vtable)
121         *(.data*)
122
123         . = ALIGN(4);
124         /* preinit data */
125         PROVIDE_HIDDEN (__preinit_array_start = .);
126         KEEP(*(.preinit_array))
127         PROVIDE_HIDDEN (__preinit_array_end = .);
128
129         . = ALIGN(4);
130         /* init data */
131         PROVIDE_HIDDEN (__init_array_start = .);
132         KEEP(*(SORT(.init_array.*)))
133         KEEP(*(.init_array))
134         PROVIDE_HIDDEN (__init_array_end = .);
135
136
137         . = ALIGN(4);
138         /* finit data */
139         PROVIDE_HIDDEN (__fini_array_start = .);
140         KEEP(*(SORT(.fini_array.*)))
141         KEEP(*(.fini_array))
142         PROVIDE_HIDDEN (__fini_array_end = .);
143
144         . = ALIGN(4);
145         /* All data end */
146         __data_end__ = .;
147
148     } > RAM
149
150     .bss :
151     {
152         __bss_start__ = .;
153         *(.bss*)
154         *(COMMON)
155         __bss_end__ = .;
156     } > RAM
157
158     .heap :
159     {
160         __end__ = .;
161         end = __end__;
162         *(.heap*)
163         __HeapLimit = .;
164     } > RAM
165
166     /* .stack_dummy section doesn't contains any symbols. It is only
167      * used for linker to calculate size of stack sections, and assign
168      * values to stack symbols later */
169     .stack_dummy :
170     {
171         *(.stack)
172     } > RAM
173
174     /* Set stack top to end of RAM, and stack limit move down by
175      * size of stack_dummy section */
176     __StackTop = ORIGIN(RAM) + LENGTH(RAM);
177     __StackLimit = __StackTop - SIZEOF(.stack_dummy);
178     PROVIDE(__stack = __StackTop);
179
180     /* Check if data + heap + stack exceeds RAM limit */
181     ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
182 }