1 /* Linker script for Silicon Labs EFM32PG1B devices */
\r
3 /* This file is subject to the license terms as defined in ARM's */
\r
4 /* CMSIS END USER LICENSE AGREEMENT.pdf, governing the use of */
\r
7 /* Silicon Laboratories, Inc. 2015 */
\r
14 FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 262144
\r
15 RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 32768
\r
18 /* Linker script to place sections and symbol values. Should be used together
\r
19 * with other linker script that defines memory regions FLASH and RAM.
\r
20 * It references following symbols, which must be defined in code:
\r
21 * Reset_Handler : Entry of reset handler
\r
23 * It defines following symbols, which code can use without definition:
\r
26 * __copy_table_start__
\r
27 * __copy_table_end__
\r
28 * __zero_table_start__
\r
29 * __zero_table_end__
\r
32 * __preinit_array_start
\r
33 * __preinit_array_end
\r
34 * __init_array_start
\r
36 * __fini_array_start
\r
50 ENTRY(Reset_Handler)
\r
58 __Vectors_Size = __Vectors_End - __Vectors;
\r
68 *crtbegin?.o(.ctors)
\r
69 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
\r
75 *crtbegin?.o(.dtors)
\r
76 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
\r
87 *(.ARM.extab* .gnu.linkonce.armextab.*)
\r
93 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
\r
97 /* To copy multiple ROM to RAM sections,
\r
98 * uncomment .copy.table section and,
\r
99 * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */
\r
104 __copy_table_start__ = .;
\r
106 LONG (__data_start__)
\r
107 LONG (__data_end__ - __data_start__)
\r
109 LONG (__data2_start__)
\r
110 LONG (__data2_end__ - __data2_start__)
\r
111 __copy_table_end__ = .;
\r
115 /* To clear multiple BSS sections,
\r
116 * uncomment .zero.table section and,
\r
117 * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */
\r
122 __zero_table_start__ = .;
\r
123 LONG (__bss_start__)
\r
124 LONG (__bss_end__ - __bss_start__)
\r
125 LONG (__bss2_start__)
\r
126 LONG (__bss2_end__ - __bss2_start__)
\r
127 __zero_table_end__ = .;
\r
133 .data : AT (__etext)
\r
135 __data_start__ = .;
\r
143 PROVIDE_HIDDEN (__preinit_array_start = .);
\r
144 KEEP(*(.preinit_array))
\r
145 PROVIDE_HIDDEN (__preinit_array_end = .);
\r
149 PROVIDE_HIDDEN (__init_array_start = .);
\r
150 KEEP(*(SORT(.init_array.*)))
\r
151 KEEP(*(.init_array))
\r
152 PROVIDE_HIDDEN (__init_array_end = .);
\r
156 PROVIDE_HIDDEN (__fini_array_start = .);
\r
157 KEEP(*(SORT(.fini_array.*)))
\r
158 KEEP(*(.fini_array))
\r
159 PROVIDE_HIDDEN (__fini_array_end = .);
\r
188 /* .stack_dummy section doesn't contains any symbols. It is only
\r
189 * used for linker to calculate size of stack sections, and assign
\r
190 * values to stack symbols later */
\r
191 .stack_dummy (COPY):
\r
196 /* Set stack top to end of RAM, and stack limit move down by
\r
197 * size of stack_dummy section */
\r
198 __StackTop = ORIGIN(RAM) + LENGTH(RAM);
\r
199 __StackLimit = __StackTop - SIZEOF(.stack_dummy);
\r
200 PROVIDE(__stack = __StackTop);
\r
202 /* Check if data + heap + stack exceeds RAM limit */
\r
203 ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
\r
205 /* Check if FLASH usage exceeds FLASH size */
\r
206 ASSERT( LENGTH(FLASH) >= (__etext + SIZEOF(.data)), "FLASH memory overflowed !")
\r