2
0

lscript.ld 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. /* Linker Script for Zynq MP */
  2. /* Stack and Heap increased to 64KB */
  3. _STACK_SIZE = DEFINED(_STACK_SIZE) ? _STACK_SIZE : 0x10000;
  4. _HEAP_SIZE = DEFINED(_HEAP_SIZE) ? _HEAP_SIZE : 0x10000;
  5. _EL0_STACK_SIZE = DEFINED(_EL0_STACK_SIZE) ? _EL0_STACK_SIZE : 1024;
  6. _EL1_STACK_SIZE = DEFINED(_EL1_STACK_SIZE) ? _EL1_STACK_SIZE : 2048;
  7. _EL2_STACK_SIZE = DEFINED(_EL2_STACK_SIZE) ? _EL2_STACK_SIZE : 1024;
  8. /* Define Memories in the system */
  9. MEMORY
  10. {
  11. ddr4_ctrl_C0_DDR4_ADDRESS_BLOCK : ORIGIN = 0x500000000, LENGTH = 0x20000000
  12. psu_ddr_0_MEM_0 : ORIGIN = 0x0, LENGTH = 0x7FF00000
  13. psu_ddr_1_MEM_0 : ORIGIN = 0x800000000, LENGTH = 0x80000000
  14. psu_ocm_ram_0_MEM_0 : ORIGIN = 0xFFFC0000, LENGTH = 0x40000
  15. psu_qspi_linear_0_MEM_0 : ORIGIN = 0xC0000000, LENGTH = 0x20000000
  16. }
  17. /* Specify the default entry point to the program */
  18. ENTRY(_vector_table)
  19. /* Define the sections, and where they are mapped in memory */
  20. SECTIONS
  21. {
  22. .text : {
  23. KEEP (*(.vectors))
  24. *(.boot)
  25. *(.text)
  26. *(.text.*)
  27. *(.gnu.linkonce.t.*)
  28. *(.plt)
  29. *(.gnu_warning)
  30. *(.gcc_execpt_table)
  31. *(.glue_7)
  32. *(.glue_7t)
  33. *(.ARM.extab)
  34. *(.gnu.linkonce.armextab.*)
  35. } > psu_ddr_0_MEM_0
  36. .init (ALIGN(64)) : {
  37. KEEP (*(.init))
  38. } > psu_ddr_0_MEM_0
  39. .fini (ALIGN(64)) : {
  40. KEEP (*(.fini))
  41. } > psu_ddr_0_MEM_0
  42. .interp : {
  43. KEEP (*(.interp))
  44. } > psu_ddr_0_MEM_0
  45. .note-ABI-tag : {
  46. KEEP (*(.note-ABI-tag))
  47. } > psu_ddr_0_MEM_0
  48. .rodata : {
  49. . = ALIGN(64);
  50. __rodata_start = .;
  51. *(.rodata)
  52. *(.rodata.*)
  53. *(.gnu.linkonce.r.*)
  54. __rodata_end = .;
  55. } > psu_ddr_0_MEM_0
  56. .rodata1 : {
  57. . = ALIGN(64);
  58. __rodata1_start = .;
  59. *(.rodata1)
  60. *(.rodata1.*)
  61. __rodata1_end = .;
  62. } > psu_ddr_0_MEM_0
  63. .sdata2 : {
  64. . = ALIGN(64);
  65. __sdata2_start = .;
  66. *(.sdata2)
  67. *(.sdata2.*)
  68. *(.gnu.linkonce.s2.*)
  69. __sdata2_end = .;
  70. } > psu_ddr_0_MEM_0
  71. .sbss2 : {
  72. . = ALIGN(64);
  73. __sbss2_start = .;
  74. *(.sbss2)
  75. *(.sbss2.*)
  76. *(.gnu.linkonce.sb2.*)
  77. __sbss2_end = .;
  78. } > psu_ddr_0_MEM_0
  79. .data : {
  80. . = ALIGN(64);
  81. __data_start = .;
  82. *(.data)
  83. *(.data.*)
  84. *(.gnu.linkonce.d.*)
  85. *(.jcr)
  86. *(.got)
  87. *(.got.plt)
  88. __data_end = .;
  89. } > psu_ddr_0_MEM_0
  90. .data1 : {
  91. . = ALIGN(64);
  92. __data1_start = .;
  93. *(.data1)
  94. *(.data1.*)
  95. __data1_end = .;
  96. } > psu_ddr_0_MEM_0
  97. .got : {
  98. *(.got)
  99. } > psu_ddr_0_MEM_0
  100. .got1 : {
  101. *(.got1)
  102. } > psu_ddr_0_MEM_0
  103. .got2 : {
  104. *(.got2)
  105. } > psu_ddr_0_MEM_0
  106. .ctors : {
  107. . = ALIGN(64);
  108. __CTOR_LIST__ = .;
  109. ___CTORS_LIST___ = .;
  110. KEEP (*crtbegin.o(.ctors))
  111. KEEP (*(EXCLUDE_FILE(*crtend.o) .ctors))
  112. KEEP (*(SORT(.ctors.*)))
  113. KEEP (*(.ctors))
  114. __CTOR_END__ = .;
  115. ___CTORS_END___ = .;
  116. } > psu_ddr_0_MEM_0
  117. .dtors : {
  118. . = ALIGN(64);
  119. __DTOR_LIST__ = .;
  120. ___DTORS_LIST___ = .;
  121. KEEP (*crtbegin.o(.dtors))
  122. KEEP (*(EXCLUDE_FILE(*crtend.o) .dtors))
  123. KEEP (*(SORT(.dtors.*)))
  124. KEEP (*(.dtors))
  125. __DTOR_END__ = .;
  126. ___DTORS_END___ = .;
  127. } > psu_ddr_0_MEM_0
  128. .fixup : {
  129. __fixup_start = .;
  130. *(.fixup)
  131. __fixup_end = .;
  132. } > psu_ddr_0_MEM_0
  133. .eh_frame : {
  134. *(.eh_frame)
  135. } > psu_ddr_0_MEM_0
  136. .eh_framehdr : {
  137. __eh_framehdr_start = .;
  138. *(.eh_framehdr)
  139. __eh_framehdr_end = .;
  140. } > psu_ddr_0_MEM_0
  141. .gcc_except_table : {
  142. *(.gcc_except_table)
  143. } > psu_ddr_0_MEM_0
  144. .mmu_tbl0 (ALIGN(4096)) : {
  145. __mmu_tbl0_start = .;
  146. *(.mmu_tbl0)
  147. __mmu_tbl0_end = .;
  148. } > psu_ddr_0_MEM_0
  149. .mmu_tbl1 (ALIGN(4096)) : {
  150. __mmu_tbl1_start = .;
  151. *(.mmu_tbl1)
  152. __mmu_tbl1_end = .;
  153. } > psu_ddr_0_MEM_0
  154. .mmu_tbl2 (ALIGN(4096)) : {
  155. __mmu_tbl2_start = .;
  156. *(.mmu_tbl2)
  157. __mmu_tbl2_end = .;
  158. } > psu_ddr_0_MEM_0
  159. .ARM.exidx : {
  160. __exidx_start = .;
  161. *(.ARM.exidx*)
  162. *(.gnu.linkonce.armexidix.*.*)
  163. __exidx_end = .;
  164. } > psu_ddr_0_MEM_0
  165. .preinit_array : {
  166. . = ALIGN(64);
  167. __preinit_array_start = .;
  168. KEEP (*(SORT(.preinit_array.*)))
  169. KEEP (*(.preinit_array))
  170. __preinit_array_end = .;
  171. } > psu_ddr_0_MEM_0
  172. .init_array : {
  173. . = ALIGN(64);
  174. __init_array_start = .;
  175. KEEP (*(SORT(.init_array.*)))
  176. KEEP (*(.init_array))
  177. __init_array_end = .;
  178. } > psu_ddr_0_MEM_0
  179. .fini_array : {
  180. . = ALIGN(64);
  181. __fini_array_start = .;
  182. KEEP (*(SORT(.fini_array.*)))
  183. KEEP (*(.fini_array))
  184. __fini_array_end = .;
  185. } > psu_ddr_0_MEM_0
  186. .ARM.attributes : {
  187. __ARM.attributes_start = .;
  188. *(.ARM.attributes)
  189. __ARM.attributes_end = .;
  190. } > psu_ddr_0_MEM_0
  191. .sdata : {
  192. . = ALIGN(64);
  193. __sdata_start = .;
  194. *(.sdata)
  195. *(.sdata.*)
  196. *(.gnu.linkonce.s.*)
  197. __sdata_end = .;
  198. } > psu_ddr_0_MEM_0
  199. .sbss (NOLOAD) : {
  200. . = ALIGN(64);
  201. __sbss_start = .;
  202. *(.sbss)
  203. *(.sbss.*)
  204. *(.gnu.linkonce.sb.*)
  205. . = ALIGN(64);
  206. __sbss_end = .;
  207. } > psu_ddr_0_MEM_0
  208. .tdata : {
  209. . = ALIGN(64);
  210. __tdata_start = .;
  211. *(.tdata)
  212. *(.tdata.*)
  213. *(.gnu.linkonce.td.*)
  214. __tdata_end = .;
  215. } > psu_ddr_0_MEM_0
  216. .tbss : {
  217. . = ALIGN(64);
  218. __tbss_start = .;
  219. *(.tbss)
  220. *(.tbss.*)
  221. *(.gnu.linkonce.tb.*)
  222. __tbss_end = .;
  223. } > psu_ddr_0_MEM_0
  224. .bss (NOLOAD) : {
  225. . = ALIGN(64);
  226. __bss_start__ = .;
  227. *(.bss)
  228. *(.bss.*)
  229. *(.gnu.linkonce.b.*)
  230. *(COMMON)
  231. . = ALIGN(64);
  232. __bss_end__ = .;
  233. } > psu_ddr_0_MEM_0
  234. _SDA_BASE_ = __sdata_start + ((__sbss_end - __sdata_start) / 2 );
  235. _SDA2_BASE_ = __sdata2_start + ((__sbss2_end - __sdata2_start) / 2 );
  236. /* Generate Stack and Heap definitions */
  237. .heap (NOLOAD) : {
  238. . = ALIGN(64);
  239. _heap = .;
  240. HeapBase = .;
  241. _heap_start = .;
  242. . += _HEAP_SIZE;
  243. _heap_end = .;
  244. HeapLimit = .;
  245. } > psu_ddr_0_MEM_0
  246. .stack (NOLOAD) : {
  247. . = ALIGN(64);
  248. _el3_stack_end = .;
  249. . += _STACK_SIZE;
  250. __el3_stack = .;
  251. _el2_stack_end = .;
  252. . += _EL2_STACK_SIZE;
  253. . = ALIGN(64);
  254. __el2_stack = .;
  255. _el1_stack_end = .;
  256. . += _EL1_STACK_SIZE;
  257. . = ALIGN(64);
  258. __el1_stack = .;
  259. _el0_stack_end = .;
  260. . += _EL0_STACK_SIZE;
  261. . = ALIGN(64);
  262. __el0_stack = .;
  263. } > psu_ddr_0_MEM_0
  264. _end = .;
  265. }