MIMXRT1052xxxxx_sdram_txt.ld 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. /*
  2. ** ###################################################################
  3. ** Processors: MIMXRT1052CVL5A
  4. ** MIMXRT1052DVL6A
  5. **
  6. ** Compiler: GNU C Compiler
  7. ** Reference manual: IMXRT1050RM Rev.C, 08/2017
  8. ** Version: rev. 0.1, 2017-01-10
  9. ** Build: b170927
  10. **
  11. ** Abstract:
  12. ** Linker file for the GNU C Compiler
  13. **
  14. ** Copyright 2016 Freescale Semiconductor, Inc.
  15. ** Copyright 2016-2017 NXP
  16. ** Redistribution and use in source and binary forms, with or without modification,
  17. ** are permitted provided that the following conditions are met:
  18. **
  19. ** 1. Redistributions of source code must retain the above copyright notice, this list
  20. ** of conditions and the following disclaimer.
  21. **
  22. ** 2. Redistributions in binary form must reproduce the above copyright notice, this
  23. ** list of conditions and the following disclaimer in the documentation and/or
  24. ** other materials provided with the distribution.
  25. **
  26. ** 3. Neither the name of the copyright holder nor the names of its
  27. ** contributors may be used to endorse or promote products derived from this
  28. ** software without specific prior written permission.
  29. **
  30. ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  31. ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  32. ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  33. ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
  34. ** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  35. ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  36. ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  37. ** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  38. ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  39. ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  40. **
  41. ** http: www.nxp.com
  42. ** mail: support@nxp.com
  43. **
  44. ** ###################################################################
  45. */
  46. /* Entry Point */
  47. ENTRY(Reset_Handler)
  48. HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400;
  49. STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0400;
  50. /* Specify the memory areas */
  51. MEMORY
  52. {
  53. m_interrupts (RX) : ORIGIN = 0x80000000, LENGTH = 0x00000400
  54. m_text (RX) : ORIGIN = 0x80000400, LENGTH = 0x001FFC00
  55. m_data (RW) : ORIGIN = 0x20200000, LENGTH = 0x00040000
  56. m_ncache (RW) : ORIGIN = 0x81E00000, LENGTH = 0x00200000
  57. }
  58. /* Define output sections */
  59. SECTIONS
  60. {
  61. /* The startup code goes first into internal RAM */
  62. .interrupts :
  63. {
  64. __VECTOR_TABLE = .;
  65. . = ALIGN(4);
  66. KEEP(*(.isr_vector)) /* Startup code */
  67. . = ALIGN(4);
  68. } > m_interrupts
  69. __VECTOR_RAM = __VECTOR_TABLE;
  70. __RAM_VECTOR_TABLE_SIZE_BYTES = 0x0;
  71. /* The program code and other data goes into internal RAM */
  72. .text :
  73. {
  74. . = ALIGN(4);
  75. *(.text) /* .text sections (code) */
  76. *(.text*) /* .text* sections (code) */
  77. *(.rodata) /* .rodata sections (constants, strings, etc.) */
  78. *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
  79. *(.glue_7) /* glue arm to thumb code */
  80. *(.glue_7t) /* glue thumb to arm code */
  81. *(.eh_frame)
  82. KEEP (*(.init))
  83. KEEP (*(.fini))
  84. . = ALIGN(4);
  85. } > m_text
  86. .ARM.extab :
  87. {
  88. *(.ARM.extab* .gnu.linkonce.armextab.*)
  89. } > m_text
  90. .ARM :
  91. {
  92. __exidx_start = .;
  93. *(.ARM.exidx*)
  94. __exidx_end = .;
  95. } > m_text
  96. .ctors :
  97. {
  98. PROVIDE(__ctors_start__ = .);
  99. /* __CTOR_LIST__ = .; */
  100. /* gcc uses crtbegin.o to find the start of
  101. the constructors, so we make sure it is
  102. first. Because this is a wildcard, it
  103. doesn't matter if the user does not
  104. actually link against crtbegin.o; the
  105. linker won't look for a file to match a
  106. wildcard. The wildcard also means that it
  107. doesn't matter which directory crtbegin.o
  108. is in. */
  109. KEEP (*crtbegin.o(.ctors))
  110. KEEP (*crtbegin?.o(.ctors))
  111. /* We don't want to include the .ctor section from
  112. from the crtend.o file until after the sorted ctors.
  113. The .ctor section from the crtend file contains the
  114. end of ctors marker and it must be last */
  115. KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors))
  116. KEEP (*(SORT(.ctors.*)))
  117. KEEP (*(.ctors))
  118. /* __CTOR_END__ = .; */
  119. PROVIDE(__ctors_end__ = .);
  120. } > m_text
  121. .dtors :
  122. {
  123. PROVIDE(__dtors_start__ = .);
  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. PROVIDE(__dtors_end__ = .);
  132. } > m_text
  133. .preinit_array :
  134. {
  135. PROVIDE_HIDDEN (__preinit_array_start = .);
  136. KEEP (*(.preinit_array*))
  137. PROVIDE_HIDDEN (__preinit_array_end = .);
  138. } > m_text
  139. .init_array :
  140. {
  141. PROVIDE_HIDDEN (__init_array_start = .);
  142. KEEP (*(SORT(.init_array.*)))
  143. KEEP (*(.init_array*))
  144. PROVIDE_HIDDEN (__init_array_end = .);
  145. } > m_text
  146. .fini_array :
  147. {
  148. PROVIDE_HIDDEN (__fini_array_start = .);
  149. KEEP (*(SORT(.fini_array.*)))
  150. KEEP (*(.fini_array*))
  151. PROVIDE_HIDDEN (__fini_array_end = .);
  152. } > m_text
  153. __etext = .; /* define a global symbol at end of code */
  154. __DATA_ROM = .; /* Symbol is used by startup for data initialization */
  155. .data : AT(__DATA_ROM)
  156. {
  157. . = ALIGN(4);
  158. __DATA_RAM = .;
  159. __data_start__ = .; /* create a global symbol at data start */
  160. *(m_usb_dma_init_data)
  161. *(.data) /* .data sections */
  162. *(.data*) /* .data* sections */
  163. KEEP(*(.jcr*))
  164. . = ALIGN(4);
  165. __data_end__ = .; /* define a global symbol at data end */
  166. } > m_data
  167. __NDATA_ROM = __DATA_ROM + (__data_end__ - __data_start__);
  168. .ncache.init : AT(__NDATA_ROM)
  169. {
  170. __noncachedata_start__ = .; /* create a global symbol at ncache data start */
  171. *(NonCacheable.init)
  172. . = ALIGN(4);
  173. __noncachedata_init_end__ = .; /* create a global symbol at initialized ncache data end */
  174. } > m_ncache
  175. . = __noncachedata_init_end__;
  176. .ncache :
  177. {
  178. *(NonCacheable)
  179. . = ALIGN(4);
  180. __noncachedata_end__ = .; /* define a global symbol at ncache data end */
  181. } > m_ncache
  182. __DATA_END = __NDATA_ROM + (__noncachedata_init_end__ - __noncachedata_start__);
  183. text_end = ORIGIN(m_text) + LENGTH(m_text);
  184. ASSERT(__DATA_END <= text_end, "region m_text overflowed with text and data")
  185. /* Uninitialized data section */
  186. .bss :
  187. {
  188. /* This is used by the startup in order to initialize the .bss section */
  189. . = ALIGN(4);
  190. __START_BSS = .;
  191. __bss_start__ = .;
  192. *(m_usb_dma_noninit_data)
  193. *(.bss)
  194. *(.bss*)
  195. *(COMMON)
  196. . = ALIGN(4);
  197. __bss_end__ = .;
  198. __END_BSS = .;
  199. } > m_data
  200. .heap :
  201. {
  202. . = ALIGN(8);
  203. __end__ = .;
  204. PROVIDE(end = .);
  205. __HeapBase = .;
  206. . += HEAP_SIZE;
  207. __HeapLimit = .;
  208. __heap_limit = .; /* Add for _sbrk */
  209. } > m_data
  210. .stack :
  211. {
  212. . = ALIGN(8);
  213. . += STACK_SIZE;
  214. } > m_data
  215. /* Initializes stack on the end of block */
  216. __StackTop = ORIGIN(m_data) + LENGTH(m_data);
  217. __StackLimit = __StackTop - STACK_SIZE;
  218. PROVIDE(__stack = __StackTop);
  219. .ARM.attributes 0 : { *(.ARM.attributes) }
  220. ASSERT(__StackLimit >= __HeapLimit, "region m_data overflowed with stack and heap")
  221. }