MIMXRT1176xxxxx_cm7_ram.ld 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. /*
  2. ** ###################################################################
  3. ** Processors: MIMXRT1176AVM8A_cm7
  4. ** MIMXRT1176CVM8A_cm7
  5. ** MIMXRT1176DVMAA_cm7
  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. /* Specify the memory areas */
  31. MEMORY
  32. {
  33. m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000400
  34. m_text (RX) : ORIGIN = 0x00000400, LENGTH = 0x0003FC00
  35. m_data (RW) : ORIGIN = 0x20000000, LENGTH = 0x00040000
  36. m_data2 (RW) : ORIGIN = 0x202C0000, LENGTH = 0x00080000
  37. }
  38. /* Define output sections */
  39. SECTIONS
  40. {
  41. __NCACHE_REGION_START = ORIGIN(m_data2);
  42. __NCACHE_REGION_SIZE = 0;
  43. /* The startup code goes first into internal RAM */
  44. .interrupts :
  45. {
  46. __VECTOR_TABLE = .;
  47. __Vectors = .;
  48. . = ALIGN(4);
  49. KEEP(*(.isr_vector)) /* Startup code */
  50. . = ALIGN(4);
  51. } > m_interrupts
  52. /* The program code and other data goes into internal RAM */
  53. .text :
  54. {
  55. . = ALIGN(4);
  56. *(.text) /* .text sections (code) */
  57. *(.text*) /* .text* sections (code) */
  58. *(.rodata) /* .rodata sections (constants, strings, etc.) */
  59. *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
  60. *(CodeQuickAccess) /* quick access code section */
  61. *(.glue_7) /* glue arm to thumb code */
  62. *(.glue_7t) /* glue thumb to arm code */
  63. *(.eh_frame)
  64. KEEP (*(.init))
  65. KEEP (*(.fini))
  66. . = ALIGN(4);
  67. } > m_text
  68. .ARM.extab :
  69. {
  70. *(.ARM.extab* .gnu.linkonce.armextab.*)
  71. } > m_text
  72. .ARM :
  73. {
  74. __exidx_start = .;
  75. *(.ARM.exidx*)
  76. __exidx_end = .;
  77. } > m_text
  78. .ctors :
  79. {
  80. __CTOR_LIST__ = .;
  81. /* gcc uses crtbegin.o to find the start of
  82. the constructors, so we make sure it is
  83. first. Because this is a wildcard, it
  84. doesn't matter if the user does not
  85. actually link against crtbegin.o; the
  86. linker won't look for a file to match a
  87. wildcard. The wildcard also means that it
  88. doesn't matter which directory crtbegin.o
  89. is in. */
  90. KEEP (*crtbegin.o(.ctors))
  91. KEEP (*crtbegin?.o(.ctors))
  92. /* We don't want to include the .ctor section from
  93. from the crtend.o file until after the sorted ctors.
  94. The .ctor section from the crtend file contains the
  95. end of ctors marker and it must be last */
  96. KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors))
  97. KEEP (*(SORT(.ctors.*)))
  98. KEEP (*(.ctors))
  99. __CTOR_END__ = .;
  100. } > m_text
  101. .dtors :
  102. {
  103. __DTOR_LIST__ = .;
  104. KEEP (*crtbegin.o(.dtors))
  105. KEEP (*crtbegin?.o(.dtors))
  106. KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors))
  107. KEEP (*(SORT(.dtors.*)))
  108. KEEP (*(.dtors))
  109. __DTOR_END__ = .;
  110. } > m_text
  111. .preinit_array :
  112. {
  113. PROVIDE_HIDDEN (__preinit_array_start = .);
  114. KEEP (*(.preinit_array*))
  115. PROVIDE_HIDDEN (__preinit_array_end = .);
  116. } > m_text
  117. .init_array :
  118. {
  119. PROVIDE_HIDDEN (__init_array_start = .);
  120. KEEP (*(SORT(.init_array.*)))
  121. KEEP (*(.init_array*))
  122. PROVIDE_HIDDEN (__init_array_end = .);
  123. } > m_text
  124. .fini_array :
  125. {
  126. PROVIDE_HIDDEN (__fini_array_start = .);
  127. KEEP (*(SORT(.fini_array.*)))
  128. KEEP (*(.fini_array*))
  129. PROVIDE_HIDDEN (__fini_array_end = .);
  130. } > m_text
  131. __etext = .; /* define a global symbol at end of code */
  132. __DATA_ROM = .; /* Symbol is used by startup for data initialization */
  133. __VECTOR_RAM = ORIGIN(m_interrupts);
  134. __RAM_VECTOR_TABLE_SIZE_BYTES = 0x0;
  135. .data : AT(__DATA_ROM)
  136. {
  137. . = ALIGN(4);
  138. __DATA_RAM = .;
  139. __data_start__ = .; /* create a global symbol at data start */
  140. *(m_usb_dma_init_data)
  141. *(.data) /* .data sections */
  142. *(.data*) /* .data* sections */
  143. *(DataQuickAccess) /* quick access data section */
  144. KEEP(*(.jcr*))
  145. . = ALIGN(4);
  146. __data_end__ = .; /* define a global symbol at data end */
  147. } > m_data
  148. __NDATA_ROM = __DATA_ROM + (__data_end__ - __data_start__);
  149. .ncache.init : AT(__NDATA_ROM)
  150. {
  151. __noncachedata_start__ = .; /* create a global symbol at ncache data start */
  152. *(NonCacheable.init)
  153. . = ALIGN(4);
  154. __noncachedata_init_end__ = .; /* create a global symbol at initialized ncache data end */
  155. } > m_data
  156. . = __noncachedata_init_end__;
  157. .ncache :
  158. {
  159. *(NonCacheable)
  160. . = ALIGN(4);
  161. __noncachedata_end__ = .; /* define a global symbol at ncache data end */
  162. } > m_data
  163. __DATA_END = __NDATA_ROM + (__noncachedata_init_end__ - __noncachedata_start__);
  164. text_end = ORIGIN(m_text) + LENGTH(m_text);
  165. ASSERT(__DATA_END <= text_end, "region m_text overflowed with text and data")
  166. /* Uninitialized data section */
  167. .bss :
  168. {
  169. /* This is used by the startup in order to initialize the .bss section */
  170. . = ALIGN(4);
  171. __START_BSS = .;
  172. __bss_start__ = .;
  173. *(m_usb_dma_noninit_data)
  174. *(.bss)
  175. *(.bss*)
  176. *(COMMON)
  177. . = ALIGN(4);
  178. __bss_end__ = .;
  179. __END_BSS = .;
  180. } > m_data
  181. .heap :
  182. {
  183. . = ALIGN(8);
  184. __end__ = .;
  185. PROVIDE(end = .);
  186. __HeapBase = .;
  187. . += HEAP_SIZE;
  188. __HeapLimit = .;
  189. __heap_limit = .; /* Add for _sbrk */
  190. } > m_data
  191. .stack :
  192. {
  193. . = ALIGN(8);
  194. . += STACK_SIZE;
  195. } > m_data
  196. /* Initializes stack on the end of block */
  197. __StackTop = ORIGIN(m_data) + LENGTH(m_data);
  198. __StackLimit = __StackTop - STACK_SIZE;
  199. PROVIDE(__stack = __StackTop);
  200. .ARM.attributes 0 : { *(.ARM.attributes) }
  201. ASSERT(__StackLimit >= __HeapLimit, "region m_data overflowed with stack and heap")
  202. }