MIMXRT1176xxxxx_cm4_ram.ld 7.1 KB

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