4 * \brief Linker script for running in internal FLASH on the SAMD51J18A
6 * Copyright (c) 2017 Microchip Technology Inc.
12 * SPDX-License-Identifier: Apache-2.0
14 * Licensed under the Apache License, Version 2.0 (the "License"); you may
15 * not use this file except in compliance with the License.
16 * You may obtain a copy of the Licence at
18 * http://www.apache.org/licenses/LICENSE-2.0
20 * Unless required by applicable law or agreed to in writing, software
21 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
22 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 * See the License for the specific language governing permissions and
24 * limitations under the License.
31 OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
35 /* Memory Spaces Definitions */
38 //rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000
39 rom (rx) : ORIGIN = 0x00004000, LENGTH = 0x0003C000
40 ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00020000
41 bkupram (rwx) : ORIGIN = 0x47000000, LENGTH = 0x00002000
42 qspi (rwx) : ORIGIN = 0x04000000, LENGTH = 0x01000000
45 /* The stack size used by the application. NOTE: you need to adjust according to your application. */
46 STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x8000;
50 _erom = ORIGIN(rom) + LENGTH(rom);
52 /* Section Definitions */
59 KEEP(*(.vectors .vectors.*))
60 *(.text .text.* .gnu.linkonce.t.*)
61 *(.glue_7t) *(.glue_7)
62 *(.rodata .rodata* .gnu.linkonce.r.*)
63 *(.ARM.extab* .gnu.linkonce.armextab.*)
65 /* Support C constructors, and C destructors in both user code
66 and the C library. This also provides support for C++ code. */
70 __preinit_array_start = .;
71 KEEP (*(.preinit_array))
72 __preinit_array_end = .;
75 __init_array_start = .;
76 KEEP (*(SORT(.init_array.*)))
81 KEEP (*crtbegin.o(.ctors))
82 KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
83 KEEP (*(SORT(.ctors.*)))
84 KEEP (*crtend.o(.ctors))
90 __fini_array_start = .;
92 KEEP (*(SORT(.fini_array.*)))
95 KEEP (*crtbegin.o(.dtors))
96 KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
97 KEEP (*(SORT(.dtors.*)))
98 KEEP (*crtend.o(.dtors))
101 _efixed = .; /* End of text section */
104 /* .ARM.exidx is sorted, so has to go in its own output section. */
105 PROVIDE_HIDDEN (__exidx_start = .);
108 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
110 PROVIDE_HIDDEN (__exidx_end = .);
115 .relocate : AT (_etext)
119 *(.ramfunc .ramfunc.*);
129 *(.bkupram .bkupram.*);
143 /* .bss section which is used for uninitialized data */