cv180x_lscript.ld 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. /*
  2. * Copyright (c) 2006-2024, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2024/01/11 flyingcys The first version
  9. */
  10. INCLUDE ./cvi_board_memmap.ld
  11. _STACK_SIZE = DEFINED(_STACK_SIZE) ? _STACK_SIZE : 0x20000;
  12. /* _HEAP_SIZE = DEFINED(_HEAP_SIZE) ? _HEAP_SIZE : 0x1000000; */
  13. /*_HEAP_SIZE = 0x20000;*/
  14. _EL0_STACK_SIZE = DEFINED(_EL0_STACK_SIZE) ? _EL0_STACK_SIZE : 1024;
  15. _EL1_STACK_SIZE = DEFINED(_EL1_STACK_SIZE) ? _EL1_STACK_SIZE : 2048;
  16. _EL2_STACK_SIZE = DEFINED(_EL2_STACK_SIZE) ? _EL2_STACK_SIZE : 1024;
  17. /* Define Memories in the system */
  18. MEMORY
  19. {
  20. psu_ddr_0_MEM_0 : ORIGIN = CVIMMAP_FREERTOS_ADDR , LENGTH = CVIMMAP_FREERTOS_SIZE
  21. }
  22. /* Specify the default entry point to the program */
  23. /*ENTRY(_vector_table)*/
  24. ENTRY(_start)
  25. /* Define the sections, and where they are mapped in memory */
  26. SECTIONS
  27. {
  28. .text : {
  29. KEEP (*(.vectors))
  30. *(.boot)
  31. *(.text)
  32. *(.text.*)
  33. *(.gnu.linkonce.t.*)
  34. *(.plt)
  35. *(.gnu_warning)
  36. *(.gcc_execpt_table)
  37. *(.glue_7)
  38. *(.glue_7t)
  39. *(.ARM.extab)
  40. *(.gnu.linkonce.armextab.*)
  41. /* section information for finsh shell */
  42. . = ALIGN(8);
  43. __fsymtab_start = .;
  44. KEEP(*(FSymTab))
  45. __fsymtab_end = .;
  46. . = ALIGN(8);
  47. __vsymtab_start = .;
  48. KEEP(*(VSymTab))
  49. __vsymtab_end = .;
  50. . = ALIGN(8);
  51. /* section information for initial. */
  52. . = ALIGN(8);
  53. __rt_init_start = .;
  54. KEEP(*(SORT(.rti_fn*)))
  55. __rt_init_end = .;
  56. . = ALIGN(8);
  57. __rt_utest_tc_tab_start = .;
  58. KEEP(*(UtestTcTab))
  59. __rt_utest_tc_tab_end = .;
  60. } > psu_ddr_0_MEM_0
  61. .init (ALIGN(64)) : {
  62. KEEP (*(.init))
  63. } > psu_ddr_0_MEM_0
  64. .fini (ALIGN(64)) : {
  65. KEEP (*(.fini))
  66. } > psu_ddr_0_MEM_0
  67. .interp : {
  68. KEEP (*(.interp))
  69. } > psu_ddr_0_MEM_0
  70. .note-ABI-tag : {
  71. KEEP (*(.note-ABI-tag))
  72. } > psu_ddr_0_MEM_0
  73. .rodata : {
  74. . = ALIGN(64);
  75. __rodata_start = .;
  76. *(.rodata)
  77. *(.rodata.*)
  78. *(.srodata*)
  79. *(.gnu.linkonce.r.*)
  80. __rodata_end = .;
  81. } > psu_ddr_0_MEM_0
  82. .rodata1 : {
  83. . = ALIGN(64);
  84. __rodata1_start = .;
  85. *(.rodata1)
  86. *(.rodata1.*)
  87. __rodata1_end = .;
  88. } > psu_ddr_0_MEM_0
  89. .data : {
  90. . = ALIGN(64);
  91. _data = .;
  92. *(.data)
  93. *(.data.*)
  94. *(.sdata)
  95. *(.sdata.*)
  96. *(.gnu.linkonce.d.*)
  97. *(.jcr)
  98. *(.got)
  99. *(.got.plt)
  100. _edata = .;
  101. } > psu_ddr_0_MEM_0
  102. .data1 : {
  103. . = ALIGN(64);
  104. __data1_start = .;
  105. *(.data1)
  106. *(.data1.*)
  107. __data1_end = .;
  108. } > psu_ddr_0_MEM_0
  109. .got : {
  110. *(.got)
  111. } > psu_ddr_0_MEM_0
  112. .got1 : {
  113. *(.got1)
  114. } > psu_ddr_0_MEM_0
  115. .got2 : {
  116. *(.got2)
  117. } > psu_ddr_0_MEM_0
  118. .ctors : {
  119. . = ALIGN(64);
  120. __CTOR_LIST__ = .;
  121. ___CTORS_LIST___ = .;
  122. KEEP (*crtbegin.o(.ctors))
  123. KEEP (*(EXCLUDE_FILE(*crtend.o) .ctors))
  124. KEEP (*(SORT(.ctors.*)))
  125. KEEP (*(.ctors))
  126. __CTOR_END__ = .;
  127. ___CTORS_END___ = .;
  128. } > psu_ddr_0_MEM_0
  129. .dtors : {
  130. . = ALIGN(64);
  131. __DTOR_LIST__ = .;
  132. ___DTORS_LIST___ = .;
  133. KEEP (*crtbegin.o(.dtors))
  134. KEEP (*(EXCLUDE_FILE(*crtend.o) .dtors))
  135. KEEP (*(SORT(.dtors.*)))
  136. KEEP (*(.dtors))
  137. __DTOR_END__ = .;
  138. ___DTORS_END___ = .;
  139. } > psu_ddr_0_MEM_0
  140. .fixup : {
  141. __fixup_start = .;
  142. *(.fixup)
  143. __fixup_end = .;
  144. } > psu_ddr_0_MEM_0
  145. .eh_frame : {
  146. *(.eh_frame)
  147. } > psu_ddr_0_MEM_0
  148. .eh_framehdr : {
  149. __eh_framehdr_start = .;
  150. *(.eh_framehdr)
  151. __eh_framehdr_end = .;
  152. } > psu_ddr_0_MEM_0
  153. .gcc_except_table : {
  154. *(.gcc_except_table)
  155. } > psu_ddr_0_MEM_0
  156. .bss (NOLOAD) : {
  157. . = ALIGN(64);
  158. _bss = .;
  159. *(.bss)
  160. *(.bss.*)
  161. *(.sbss)
  162. *(.sbss.*)
  163. *(.gnu.linkonce.b.*)
  164. *(COMMON)
  165. . = ALIGN(64);
  166. _ebss = .;
  167. } > psu_ddr_0_MEM_0
  168. /*_SDA_BASE_ = __sdata_start + ((__sbss_end - __sdata_start) / 2 );*/
  169. _data_lma = LOADADDR(.data);
  170. /* Generate Stack and Heap definitions */
  171. .stack (NOLOAD) : {
  172. . = ALIGN(64);
  173. _stack_end_end = .;
  174. . += _STACK_SIZE;
  175. _stack_top = .;
  176. __rt_rvstack = .;
  177. } > psu_ddr_0_MEM_0
  178. .heap (NOLOAD) : {
  179. . = ALIGN(64);
  180. _heap = .;
  181. HeapBase = .;
  182. _heap_start = .;
  183. *(.heap*)
  184. /*. += _HEAP_SIZE;*/
  185. /*_heap_size = _HEAP_SIZE; */
  186. _heap_end = .;
  187. HeapLimit = .;
  188. } > psu_ddr_0_MEM_0
  189. HeapLimit = ORIGIN(psu_ddr_0_MEM_0) + LENGTH(psu_ddr_0_MEM_0);
  190. _end = .;
  191. }