1/* 2** ################################################################### 3** Processors: MIMXRT1061CVJ5A 4** MIMXRT1061CVJ5B 5** MIMXRT1061CVL5A 6** MIMXRT1061CVL5B 7** MIMXRT1061DVJ6A 8** MIMXRT1061DVJ6B 9** MIMXRT1061DVL6A 10** MIMXRT1061DVL6B 11** MIMXRT1061XVN5B 12** 13** Compiler: GNU C Compiler 14** Reference manual: IMXRT1060RM Rev.3, 07/2021 | IMXRT106XSRM Rev.0 15** Version: rev. 0.2, 2022-03-25 16** Build: b221009 17** 18** Abstract: 19** Linker file for the GNU C Compiler 20** 21** Copyright 2016 Freescale Semiconductor, Inc. 22** Copyright 2016-2022 NXP 23** All rights reserved. 24** 25** SPDX-License-Identifier: BSD-3-Clause 26** 27** http: www.nxp.com 28** mail: support@nxp.com 29** 30** ################################################################### 31*/ 32 33/* Entry Point */ 34ENTRY(Reset_Handler) 35 36HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400; 37STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0400; 38NCACHE_HEAP_START = DEFINED(__heap_noncacheable__) ? 0x82000000 - HEAP_SIZE : 0x81E00000 - HEAP_SIZE; 39NCACHE_HEAP_SIZE = DEFINED(__heap_noncacheable__) ? HEAP_SIZE : 0x0000; 40 41/* Specify the memory areas */ 42MEMORY 43{ 44 m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000400 45 m_text (RX) : ORIGIN = 0x00000400, LENGTH = 0x0001FC00 46 m_data (RW) : ORIGIN = 0x80000000, LENGTH = DEFINED(__heap_noncacheable__) ? 0x01E00000 : 0x01E00000 - HEAP_SIZE 47 m_ncache (RW) : ORIGIN = 0x81E00000, LENGTH = DEFINED(__heap_noncacheable__) ? 0x00200000 - HEAP_SIZE : 0x00200000 48 m_data2 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00020000 49 m_data3 (RW) : ORIGIN = 0x20200000, LENGTH = 0x000C0000 50 m_heap (RW) : ORIGIN = NCACHE_HEAP_START, LENGTH = HEAP_SIZE 51} 52 53/* Define output sections */ 54SECTIONS 55{ 56 __NCACHE_REGION_START = ORIGIN(m_ncache); 57 __NCACHE_REGION_SIZE = LENGTH(m_ncache) + NCACHE_HEAP_SIZE; 58 59 /* The startup code goes first into internal RAM */ 60 .interrupts : 61 { 62 __VECTOR_TABLE = .; 63 __Vectors = .; 64 . = ALIGN(4); 65 KEEP(*(.isr_vector)) /* Startup code */ 66 . = ALIGN(4); 67 } > m_interrupts 68 69 /* The program code and other data goes into internal RAM */ 70 .text : 71 { 72 . = ALIGN(4); 73 *(.text) /* .text sections (code) */ 74 *(.text*) /* .text* sections (code) */ 75 *(.rodata) /* .rodata sections (constants, strings, etc.) */ 76 *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ 77 *(CodeQuickAccess) /* quick access code section */ 78 *(.glue_7) /* glue arm to thumb code */ 79 *(.glue_7t) /* glue thumb to arm code */ 80 *(.eh_frame) 81 KEEP (*(.init)) 82 KEEP (*(.fini)) 83 . = ALIGN(4); 84 } > m_text 85 86 .ARM.extab : 87 { 88 *(.ARM.extab* .gnu.linkonce.armextab.*) 89 } > m_text 90 91 .ARM : 92 { 93 __exidx_start = .; 94 *(.ARM.exidx*) 95 __exidx_end = .; 96 } > m_text 97 98 .ctors : 99 { 100 __CTOR_LIST__ = .; 101 /* gcc uses crtbegin.o to find the start of 102 the constructors, so we make sure it is 103 first. Because this is a wildcard, it 104 doesn't matter if the user does not 105 actually link against crtbegin.o; the 106 linker won't look for a file to match a 107 wildcard. The wildcard also means that it 108 doesn't matter which directory crtbegin.o 109 is in. */ 110 KEEP (*crtbegin.o(.ctors)) 111 KEEP (*crtbegin?.o(.ctors)) 112 /* We don't want to include the .ctor section from 113 from the crtend.o file until after the sorted ctors. 114 The .ctor section from the crtend file contains the 115 end of ctors marker and it must be last */ 116 KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)) 117 KEEP (*(SORT(.ctors.*))) 118 KEEP (*(.ctors)) 119 __CTOR_END__ = .; 120 } > m_text 121 122 .dtors : 123 { 124 __DTOR_LIST__ = .; 125 KEEP (*crtbegin.o(.dtors)) 126 KEEP (*crtbegin?.o(.dtors)) 127 KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)) 128 KEEP (*(SORT(.dtors.*))) 129 KEEP (*(.dtors)) 130 __DTOR_END__ = .; 131 } > m_text 132 133 .preinit_array : 134 { 135 PROVIDE_HIDDEN (__preinit_array_start = .); 136 KEEP (*(.preinit_array*)) 137 PROVIDE_HIDDEN (__preinit_array_end = .); 138 } > m_text 139 140 .init_array : 141 { 142 PROVIDE_HIDDEN (__init_array_start = .); 143 KEEP (*(SORT(.init_array.*))) 144 KEEP (*(.init_array*)) 145 PROVIDE_HIDDEN (__init_array_end = .); 146 } > m_text 147 148 .fini_array : 149 { 150 PROVIDE_HIDDEN (__fini_array_start = .); 151 KEEP (*(SORT(.fini_array.*))) 152 KEEP (*(.fini_array*)) 153 PROVIDE_HIDDEN (__fini_array_end = .); 154 } > m_text 155 156 __etext = .; /* define a global symbol at end of code */ 157 __DATA_ROM = .; /* Symbol is used by startup for data initialization */ 158 159 __VECTOR_RAM = ORIGIN(m_interrupts); 160 __RAM_VECTOR_TABLE_SIZE_BYTES = 0x0; 161 162 .data : AT(__DATA_ROM) 163 { 164 . = ALIGN(4); 165 __DATA_RAM = .; 166 __data_start__ = .; /* create a global symbol at data start */ 167 *(m_usb_dma_init_data) 168 *(.data) /* .data sections */ 169 *(.data*) /* .data* sections */ 170 KEEP(*(.jcr*)) 171 . = ALIGN(4); 172 __data_end__ = .; /* define a global symbol at data end */ 173 } > m_data 174 175 __NDATA_ROM = __DATA_ROM + (__data_end__ - __data_start__); 176 .ncache.init : AT(__NDATA_ROM) 177 { 178 __noncachedata_start__ = .; /* create a global symbol at ncache data start */ 179 *(NonCacheable.init) 180 . = ALIGN(4); 181 __noncachedata_init_end__ = .; /* create a global symbol at initialized ncache data end */ 182 } > m_ncache 183 . = __noncachedata_init_end__; 184 .ncache : 185 { 186 *(NonCacheable) 187 . = ALIGN(4); 188 __noncachedata_end__ = .; /* define a global symbol at ncache data end */ 189 } > m_ncache 190 191 __DATA_END = __NDATA_ROM + (__noncachedata_init_end__ - __noncachedata_start__); 192 text_end = ORIGIN(m_text) + LENGTH(m_text); 193 ASSERT(__DATA_END <= text_end, "region m_text overflowed with text and data") 194 195 .qadata : 196 { 197 . = ALIGN(4); 198 *(DataQuickAccess) /* quick access data section */ 199 . = ALIGN(4); 200 } > m_data2 201 202 /* Uninitialized data section */ 203 .bss : 204 { 205 /* This is used by the startup in order to initialize the .bss section */ 206 . = ALIGN(4); 207 __START_BSS = .; 208 __bss_start__ = .; 209 *(m_usb_dma_noninit_data) 210 *(.bss) 211 *(.bss*) 212 *(COMMON) 213 . = ALIGN(4); 214 __bss_end__ = .; 215 __END_BSS = .; 216 } > m_data 217 218 .heap : 219 { 220 . = ALIGN(8); 221 __end__ = .; 222 PROVIDE(end = .); 223 __HeapBase = .; 224 . += HEAP_SIZE; 225 __HeapLimit = .; 226 __heap_limit = .; /* Add for _sbrk */ 227 } > m_heap 228 229 .stack : 230 { 231 . = ALIGN(8); 232 . += STACK_SIZE; 233 } > m_data 234 235 /* Initializes stack on the end of block */ 236 __StackTop = ORIGIN(m_data) + LENGTH(m_data); 237 __StackLimit = __StackTop - STACK_SIZE; 238 PROVIDE(__stack = __StackTop); 239 240 .ARM.attributes 0 : { *(.ARM.attributes) } 241} 242