MIMXRT1052xxxxx_ram.ld 6.0 KB

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