link.lds 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. /*
  2. * S100 MCU1 linker script for RT-Thread on Cortex-R52.
  3. *
  4. * This keeps the current MCU1 memory layout from the FreeRTOS image and
  5. * adds the symbols/sections RT-Thread's Cortex-R52 GCC port expects.
  6. */
  7. OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
  8. OUTPUT_ARCH(arm)
  9. ENTRY(EL2_core_exceptions_table)
  10. STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0000C000;
  11. STACK_SIZE_EXC = DEFINED(__stack_size_exc__) ? __stack_size_exc__ : 0x0000C000;
  12. MEMORY
  13. {
  14. FLASH_STARTUP (rx) : ORIGIN = 0x0CAB0000, LENGTH = 4K
  15. FLASH (rwx) : ORIGIN = 0x0CAB1000, LENGTH = 2154K
  16. RTOS_HEAP (rw) : ORIGIN = 0x0CCCB000, LENGTH = 512K
  17. CAN_Reserved (rw) : ORIGIN = 0x0CD4B000, LENGTH = 64K
  18. LOG_SHARE_Reserved (rw) : ORIGIN = 0x0CD5B000, LENGTH = 8K
  19. SCMI_IPC_Reserved (rw) : ORIGIN = 0x0CD5D000, LENGTH = 12K
  20. ATCM_Reserved (rwx) : ORIGIN = 0x0A000000, LENGTH = 64K
  21. }
  22. SECTIONS
  23. {
  24. .startup :
  25. {
  26. . = ALIGN(32);
  27. __startup_start = .;
  28. KEEP(*(.EL2_core_exceptions_table))
  29. . = ALIGN(32);
  30. KEEP(*(.EL1_core_exceptions_table))
  31. . = ALIGN(32);
  32. KEEP(*(.EL2_Reset_Handler))
  33. . = ALIGN(4);
  34. KEEP(*(.text.entrypoint))
  35. KEEP(*(.vectors))
  36. . = ALIGN(32);
  37. __startup_end = .;
  38. } > FLASH_STARTUP
  39. .text :
  40. {
  41. PROVIDE(__text_start = .);
  42. *(.text) /* remaining code */
  43. *(.text.*) /* remaining code */
  44. *(.glue_7)
  45. *(.glue_7t)
  46. /* section information for utest */
  47. . = ALIGN(8);
  48. PROVIDE(__rt_utest_tc_tab_start = .);
  49. KEEP(*(UtestTcTab))
  50. PROVIDE(__rt_utest_tc_tab_end = .);
  51. /* section information for finsh shell */
  52. . = ALIGN(8);
  53. PROVIDE(__fsymtab_start = .);
  54. KEEP(*(FSymTab))
  55. PROVIDE(__fsymtab_end = .);
  56. . = ALIGN(8);
  57. PROVIDE(__vsymtab_start = .);
  58. KEEP(*(VSymTab))
  59. PROVIDE(__vsymtab_end = .);
  60. . = ALIGN(8);
  61. /* section information for modules */
  62. . = ALIGN(8);
  63. PROVIDE(__rtmsymtab_start = .);
  64. KEEP(*(RTMSymTab))
  65. PROVIDE(__rtmsymtab_end = .);
  66. /* section information for initialization */
  67. . = ALIGN(8);
  68. PROVIDE(__rt_init_start = .);
  69. KEEP(*(SORT(.rti_fn*)))
  70. PROVIDE(__rt_init_end = .);
  71. /* section information for usb usbh_class_info */
  72. . = ALIGN(4);
  73. __usbh_class_info_start__ = .;
  74. KEEP(*(.usbh_class_info))
  75. . = ALIGN(4);
  76. __usbh_class_info_end__ = .;
  77. PROVIDE(__text_end = .);
  78. } > FLASH
  79. .resource_table :
  80. {
  81. . = ALIGN(8);
  82. __resource_table_start = .;
  83. KEEP(*(.resource_table))
  84. KEEP(*(.resource_table.*))
  85. . = ALIGN(8);
  86. __resource_table_end = .;
  87. } > FLASH
  88. .ARM.extab :
  89. {
  90. *(.ARM.extab* .gnu.linkonce.armextab.*)
  91. } > FLASH
  92. .ARM.exidx :
  93. {
  94. __exidx_start = .;
  95. *(.ARM.exidx* .gnu.linkonce.armexidx.*)
  96. __exidx_end = .;
  97. } > FLASH
  98. .const :
  99. {
  100. . = ALIGN(32);
  101. *(.const)
  102. *(.rodata .rodata.*)
  103. } > FLASH
  104. .data :
  105. {
  106. . = ALIGN(64);
  107. __image_rw_start__ = .;
  108. __data_start__ = .; /* Create a global symbol at data start. */
  109. *(.data .data.*) /* .data sections */
  110. . = ALIGN(64);
  111. __data_end__ = .; /* Define a global symbol at data end. */
  112. } > FLASH
  113. .bss (NOLOAD):
  114. {
  115. /*
  116. * We need some free space to page or cpu stack, move .bss.noclean.*
  117. * to optimize size.
  118. */
  119. . = ALIGN(16);
  120. PROVIDE(__bss_noclean_start = .);
  121. *(.bss.noclean.*)
  122. PROVIDE(__bss_noclean_end = .);
  123. . = ALIGN(8);
  124. PROVIDE(__bss_start = .);
  125. *(.bss)
  126. *(.bss.*)
  127. *(.dynbss)
  128. *(COMMON)
  129. . = ALIGN(8);
  130. PROVIDE(__bss_end = .);
  131. } > FLASH
  132. .stack (NOLOAD) :
  133. {
  134. . = ALIGN(64);
  135. __STACK_START = .;
  136. __StackLimit = .;
  137. __stack_start__ = .;
  138. . += STACK_SIZE;
  139. __stack_end__ = .;
  140. __StackTop = .;
  141. } > FLASH
  142. .stack_exc (NOLOAD) :
  143. {
  144. . = ALIGN(64);
  145. __StackLimit_exc = .;
  146. __stack_start_exc__ = .;
  147. . += STACK_SIZE_EXC;
  148. __stack_end_exc__ = .;
  149. __StackTop_exc = .;
  150. . = ALIGN(64);
  151. __image_rw_end__ = .;
  152. } > FLASH
  153. _end = .;
  154. /*-------- LABELS USED IN CODE -------------------------------*/
  155. SRAM_START_ADDR = ORIGIN(FLASH_STARTUP);
  156. FLASH_STARTUP_LEN = LENGTH(FLASH_STARTUP);
  157. FLASH_SEC_ADDR = ORIGIN(FLASH);
  158. MCU_LOG_START_ADDR = ORIGIN(LOG_SHARE_Reserved);
  159. MCU_LOG_SIZE = LENGTH(LOG_SHARE_Reserved);
  160. __SCMI_IPC_START_ADDR = ORIGIN(SCMI_IPC_Reserved);
  161. __SCMI_IPC_SIZE = LENGTH(SCMI_IPC_Reserved);
  162. NON_SECURE_START_ADDR = ORIGIN(LOG_SHARE_Reserved);
  163. CAN_START_ADDR = ORIGIN(CAN_Reserved);
  164. ATCM_START_ADDR = ORIGIN(ATCM_Reserved);
  165. ATCM_SIZE = LENGTH(ATCM_Reserved);
  166. OS_HEAP_START_ADDR = ORIGIN(RTOS_HEAP);
  167. OS_HEAP_END_ADDR = ORIGIN(RTOS_HEAP) + LENGTH(RTOS_HEAP);
  168. OS_HEAP_SIZE = LENGTH(RTOS_HEAP);
  169. /* Keep __image_rw_end__ ~ OS_HEAP_START_ADDR unmapped as a guard gap. */
  170. PROVIDE(SRAM_SIZE = 0x34FFFF);
  171. PROVIDE(MCU0_LOG_START_ADDR = 0x0CAAB000); /* Base addr from MCU0 link region "LOG_SHARE_Reserved" */
  172. PROVIDE(MCU_STATE_START_ADDR = 0x0C800800);/* Base addr from MCU0 link region "MCU_STATE_Reserved" */
  173. /* Stabs debugging sections. */
  174. .stab 0 : { *(.stab) }
  175. .stabstr 0 : { *(.stabstr) }
  176. .stab.excl 0 : { *(.stab.excl) }
  177. .stab.exclstr 0 : { *(.stab.exclstr) }
  178. .stab.index 0 : { *(.stab.index) }
  179. .stab.indexstr 0 : { *(.stab.indexstr) }
  180. .comment 0 : { *(.comment) }
  181. /* DWARF debug sections.
  182. * Symbols in the DWARF debugging sections are relative to the beginning
  183. * of the section so we begin them at 0. */
  184. /* DWARF 1 */
  185. .debug 0 : { *(.debug) }
  186. .line 0 : { *(.line) }
  187. /* GNU DWARF 1 extensions */
  188. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  189. .debug_sfnames 0 : { *(.debug_sfnames) }
  190. /* DWARF 1.1 and DWARF 2 */
  191. .debug_aranges 0 : { *(.debug_aranges) }
  192. .debug_pubnames 0 : { *(.debug_pubnames) }
  193. /* DWARF 2 */
  194. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  195. .debug_abbrev 0 : { *(.debug_abbrev) }
  196. .debug_line 0 : { *(.debug_line) }
  197. .debug_frame 0 : { *(.debug_frame) }
  198. .debug_str 0 : { *(.debug_str) }
  199. .debug_loc 0 : { *(.debug_loc) }
  200. .debug_macinfo 0 : { *(.debug_macinfo) }
  201. /* SGI/MIPS DWARF 2 extensions */
  202. .debug_weaknames 0 : { *(.debug_weaknames) }
  203. .debug_funcnames 0 : { *(.debug_funcnames) }
  204. .debug_typenames 0 : { *(.debug_typenames) }
  205. .debug_varnames 0 : { *(.debug_varnames) }
  206. }