1 /*******************************************************************************
2 * Copyright (C) 2015 Maxim Integrated Products, Inc., All Rights Reserved.
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:
11 * The above copyright notice and this permission notice shall be included
12 * in all copies or substantial portions of the Software.
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.
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.
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
31 *******************************************************************************
34 /******************************************************************************
36 * Linker configuration file, default ARM Cortex M3 produced by Maxim Integrated Inc.
38 *****************************************************************************/
42 FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000 /* start from 0x0, fullsize flash, 256k */
43 RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000 /* full-size SRAM, 32k */
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
51 * It defines following symbols, which code can use without definition:
56 * __preinit_array_start
87 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
94 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
105 *(.ARM.extab* .gnu.linkonce.armextab.*)
111 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
125 PROVIDE_HIDDEN (__preinit_array_start = .);
126 KEEP(*(.preinit_array))
127 PROVIDE_HIDDEN (__preinit_array_end = .);
131 PROVIDE_HIDDEN (__init_array_start = .);
132 KEEP(*(SORT(.init_array.*)))
134 PROVIDE_HIDDEN (__init_array_end = .);
139 PROVIDE_HIDDEN (__fini_array_start = .);
140 KEEP(*(SORT(.fini_array.*)))
142 PROVIDE_HIDDEN (__fini_array_end = .);
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 */
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);
180 /* Check if data + heap + stack exceeds RAM limit */
181 ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")