ram_rtt.ld 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. /*
  2. * Copyright 2021-2023 HPMicro
  3. * SPDX-License-Identifier: BSD-3-Clause
  4. */
  5. ENTRY(_start)
  6. STACK_SIZE = DEFINED(_stack_size) ? _stack_size : 0x2000;
  7. HEAP_SIZE = DEFINED(_heap_size) ? _heap_size : 0x8000;
  8. NONCACHEABLE_SIZE = DEFINED(_noncacheable_size) ? _noncacheable_size : 0x10000;
  9. MEMORY
  10. {
  11. ILM (wx) : ORIGIN = 0, LENGTH = 128K
  12. DLM (w) : ORIGIN = 0x80000, LENGTH = 96K
  13. NONCACHEABLE_RAM (wx) : ORIGIN = 0x90000, LENGTH = NONCACHEABLE_SIZE
  14. AXI_SRAM (wx) : ORIGIN = 0x01084000, LENGTH = 224K
  15. SHARE_RAM (w) : ORIGIN = 0x010BC000, LENGTH = 16K
  16. AHB_SRAM (w) : ORIGIN = 0xF0300000, LENGTH = 32k
  17. }
  18. SECTIONS
  19. {
  20. .start : {
  21. . = ALIGN(8);
  22. KEEP(*(.start))
  23. } > ILM
  24. .vectors : {
  25. . = ALIGN(8);
  26. KEEP(*(.isr_vector))
  27. KEEP(*(.vector_table))
  28. . = ALIGN(8);
  29. } > ILM
  30. .text : {
  31. . = ALIGN(8);
  32. *(.text)
  33. *(.text*)
  34. *(.rodata)
  35. *(.rodata*)
  36. *(.srodata)
  37. *(.srodata*)
  38. *(.hash)
  39. *(.dyn*)
  40. *(.gnu*)
  41. *(.pl*)
  42. *(FalPartTable)
  43. KEEP(*(.eh_frame))
  44. *(.eh_frame*)
  45. KEEP (*(.init))
  46. KEEP (*(.fini))
  47. . = ALIGN(8);
  48. /*********************************************
  49. *
  50. * RT-Thread related sections - Start
  51. *
  52. *********************************************/
  53. /* section information for finsh shell */
  54. . = ALIGN(4);
  55. __fsymtab_start = .;
  56. KEEP(*(FSymTab))
  57. __fsymtab_end = .;
  58. . = ALIGN(4);
  59. __vsymtab_start = .;
  60. KEEP(*(VSymTab))
  61. __vsymtab_end = .;
  62. . = ALIGN(4);
  63. . = ALIGN(4);
  64. __rt_init_start = .;
  65. KEEP(*(SORT(.rti_fn*)))
  66. __rt_init_end = .;
  67. . = ALIGN(4);
  68. /* section information for modules */
  69. . = ALIGN(4);
  70. __rtmsymtab_start = .;
  71. KEEP(*(RTMSymTab))
  72. __rtmsymtab_end = .;
  73. /* RT-Thread related sections - end */
  74. /* section information for usbh class */
  75. . = ALIGN(8);
  76. __usbh_class_info_start__ = .;
  77. KEEP(*(.usbh_class_info))
  78. __usbh_class_info_end__ = .;
  79. PROVIDE (__etext = .);
  80. PROVIDE (_etext = .);
  81. PROVIDE (etext = .);
  82. } > AXI_SRAM
  83. .rel : {
  84. KEEP(*(.rel*))
  85. } > AXI_SRAM
  86. .fast_ram (NOLOAD) : {
  87. KEEP(*(.fast_ram))
  88. } > DLM
  89. .bss(NOLOAD) : {
  90. . = ALIGN(8);
  91. __bss_start__ = .;
  92. *(.bss)
  93. *(.bss*)
  94. *(.sbss*)
  95. *(.scommon)
  96. *(.scommon*)
  97. *(.dynsbss*)
  98. *(COMMON)
  99. . = ALIGN(8);
  100. _end = .;
  101. __bss_end__ = .;
  102. } > DLM
  103. /* Note: .tbss and .tdata should be adjacent */
  104. .tbss(NOLOAD) : {
  105. . = ALIGN(8);
  106. __tbss_start__ = .;
  107. *(.tbss*)
  108. *(.tcommon*)
  109. _end = .;
  110. __tbss_end__ = .;
  111. } > DLM
  112. .tdata : AT(etext) {
  113. . = ALIGN(8);
  114. __tdata_start__ = .;
  115. __thread_pointer = .;
  116. *(.tdata)
  117. *(.tdata*)
  118. . = ALIGN(8);
  119. __tdata_end__ = .;
  120. } > DLM
  121. .data : AT(etext + __tdata_end__ - __tdata_start__) {
  122. . = ALIGN(8);
  123. __data_start__ = .;
  124. __global_pointer$ = . + 0x800;
  125. *(.data)
  126. *(.data*)
  127. *(.sdata)
  128. *(.sdata*)
  129. KEEP(*(.jcr))
  130. KEEP(*(.dynamic))
  131. KEEP(*(.got*))
  132. KEEP(*(.got))
  133. KEEP(*(.gcc_except_table))
  134. KEEP(*(.gcc_except_table.*))
  135. . = ALIGN(8);
  136. PROVIDE(__preinit_array_start = .);
  137. KEEP(*(.preinit_array))
  138. PROVIDE(__preinit_array_end = .);
  139. . = ALIGN(8);
  140. PROVIDE(__init_array_start = .);
  141. KEEP(*(SORT_BY_INIT_PRIORITY(.init_array.*)))
  142. KEEP(*(.init_array))
  143. PROVIDE(__init_array_end = .);
  144. . = ALIGN(8);
  145. PROVIDE(__finit_array_start = .);
  146. KEEP(*(SORT_BY_INIT_PRIORITY(.finit_array.*)))
  147. KEEP(*(.finit_array))
  148. PROVIDE(__finit_array_end = .);
  149. . = ALIGN(8);
  150. PROVIDE(__ctors_start__ = .);
  151. KEEP(*crtbegin*.o(.ctors))
  152. KEEP(*(EXCLUDE_FILE (*crtend*.o) .ctors))
  153. KEEP(*(SORT(.ctors.*)))
  154. KEEP(*(.ctors))
  155. PROVIDE(__ctors_end__ = .);
  156. . = ALIGN(8);
  157. KEEP(*crtbegin*.o(.dtors))
  158. KEEP(*(EXCLUDE_FILE (*crtend*.o) .dtors))
  159. KEEP(*(SORT(.dtors.*)))
  160. KEEP(*(.dtors))
  161. . = ALIGN(8);
  162. __data_end__ = .;
  163. PROVIDE (__edata = .);
  164. PROVIDE (_edata = .);
  165. PROVIDE (edata = .);
  166. } > DLM
  167. .fast : AT(etext + __data_end__ - __tdata_start__) {
  168. . = ALIGN(8);
  169. PROVIDE(__ramfunc_start__ = .);
  170. *(.fast)
  171. . = ALIGN(8);
  172. PROVIDE(__ramfunc_end__ = .);
  173. } > ILM
  174. .noncacheable.init : AT(etext + __data_end__ - __tdata_start__ + __ramfunc_end__ - __ramfunc_start__) {
  175. . = ALIGN(8);
  176. __noncacheable_init_start__ = .;
  177. KEEP(*(.noncacheable.init))
  178. __noncacheable_init_end__ = .;
  179. . = ALIGN(8);
  180. } > NONCACHEABLE_RAM
  181. .sh_mem (NOLOAD) : {
  182. KEEP(*(.sh_mem))
  183. } > SHARE_RAM
  184. __share_mem_start__ = ORIGIN(SHARE_RAM);
  185. __share_mem_end__ = ORIGIN(SHARE_RAM) + LENGTH(SHARE_RAM);
  186. .noncacheable.bss (NOLOAD) : {
  187. . = ALIGN(8);
  188. KEEP(*(.noncacheable))
  189. __noncacheable_bss_start__ = .;
  190. KEEP(*(.noncacheable.bss))
  191. __noncacheable_bss_end__ = .;
  192. . = ALIGN(8);
  193. } > NONCACHEABLE_RAM
  194. __noncacheable_start__ = ORIGIN(NONCACHEABLE_RAM);
  195. __noncacheable_end__ = ORIGIN(NONCACHEABLE_RAM) + LENGTH(NONCACHEABLE_RAM);
  196. .ahb_sram (NOLOAD) : {
  197. KEEP(*(.ahb_sram))
  198. } > AHB_SRAM
  199. .stack(NOLOAD) : {
  200. . = ALIGN(8);
  201. __stack_base__ = .;
  202. . += STACK_SIZE;
  203. PROVIDE (_stack = .);
  204. PROVIDE (_stack_in_dlm = .);
  205. PROVIDE (__rt_rvstack = .);
  206. } > DLM
  207. .heap (NOLOAD) : {
  208. . = ALIGN(8);
  209. __heap_start__ = .;
  210. . += HEAP_SIZE;
  211. __heap_end__ = .;
  212. } > DLM
  213. }