2 * Copyright (c) 2020, The OpenThread Authors.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * 3. Neither the name of the copyright holder nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE.
31 * This file implements the OpenThread linker script for the
32 * Silicon Labs efr32mg13 platform.
38 FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 512K
39 RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
42 /* Linker script to place sections and symbol values. Should be used together
43 * with other linker script that defines memory regions FLASH and RAM.
44 * It references following symbols, which must be defined in code:
45 * Reset_Handler : Entry of reset handler
47 * It defines following symbols, which code can use without definition:
50 * __copy_table_start__
52 * __zero_table_start__
56 * __preinit_array_start
83 __Vectors_Size = __Vectors_End - __Vectors;
94 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
101 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
112 *(.ARM.extab* .gnu.linkonce.armextab.*)
118 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
122 /* To copy multiple ROM to RAM sections,
123 * uncomment .copy.table section and,
124 * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */
129 __copy_table_start__ = .;
131 LONG (__data_start__)
132 LONG (__data_end__ - __data_start__)
134 LONG (__data2_start__)
135 LONG (__data2_end__ - __data2_start__)
136 __copy_table_end__ = .;
140 /* To clear multiple BSS sections,
141 * uncomment .zero.table section and,
142 * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */
147 __zero_table_start__ = .;
149 LONG (__bss_end__ - __bss_start__)
150 LONG (__bss2_start__)
151 LONG (__bss2_end__ - __bss2_start__)
152 __zero_table_end__ = .;
164 PROVIDE (__ram_func_section_start = .);
166 PROVIDE (__ram_func_section_end = .);
170 PROVIDE_HIDDEN (__preinit_array_start = .);
171 KEEP(*(.preinit_array))
172 PROVIDE_HIDDEN (__preinit_array_end = .);
176 PROVIDE_HIDDEN (__init_array_start = .);
177 KEEP(*(SORT(.init_array.*)))
179 PROVIDE_HIDDEN (__init_array_end = .);
183 PROVIDE_HIDDEN (__fini_array_start = .);
184 KEEP(*(SORT(.fini_array.*)))
186 PROVIDE_HIDDEN (__fini_array_end = .);
215 /* .stack_dummy section doesn't contains any symbols. It is only
216 * used for linker to calculate size of stack sections, and assign
217 * values to stack symbols later */
223 /* Set stack top to end of RAM, and stack limit move down by
224 * size of stack_dummy section */
225 __StackTop = ORIGIN(RAM) + LENGTH(RAM);
226 __StackLimit = __StackTop - SIZEOF(.stack_dummy);
227 PROVIDE(__stack = __StackTop);
229 /*******************************************************************/
230 /* Define flash block for nvm3 */
235 linker_nvm_end = ORIGIN(FLASH) + LENGTH(FLASH);
236 linker_nvm_begin = linker_nvm_end - SIZEOF(.nvm);
237 linker_nvm_size = SIZEOF(.nvm);
238 __nvm3Base = linker_nvm_begin;
239 /*******************************************************************/
241 /* Check if data + heap + stack exceeds RAM limit */
242 ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
244 /* Check if FLASH usage exceeds FLASH size */
245 ASSERT( LENGTH(FLASH) >= (__etext + SIZEOF(.data)), "FLASH memory overflowed !")