MIMXRT1176xxxxx_cm4_sdram.ld 6.7 KB

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