link.lds 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. /*
  2. * Copyright (c) 2006-2023, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. */
  9. INCLUDE "link_stacksize.lds"
  10. /*
  11. * The OUTPUT_ARCH command specifies the machine architecture where the
  12. * argument is one of the names used in the Kendryte library.
  13. */
  14. OUTPUT_ARCH( "riscv" )
  15. MEMORY
  16. {
  17. /* 300M SRAM */
  18. SRAM : ORIGIN = 0x80000000, LENGTH = 0x12c00000
  19. }
  20. ENTRY(_start)
  21. SECTIONS
  22. {
  23. . = 0x80000000 ;
  24. /* __STACKSIZE__ = 4096; */
  25. .start :
  26. {
  27. *(.start);
  28. } > SRAM
  29. . = ALIGN(8);
  30. .text :
  31. {
  32. *(.text) /* remaining code */
  33. *(.text.*) /* remaining code */
  34. *(.rodata) /* read-only data (constants) */
  35. *(.rodata*)
  36. *(.glue_7)
  37. *(.glue_7t)
  38. *(.gnu.linkonce.t*)
  39. /* section information for finsh shell */
  40. . = ALIGN(8);
  41. __fsymtab_start = .;
  42. KEEP(*(FSymTab))
  43. __fsymtab_end = .;
  44. . = ALIGN(8);
  45. __vsymtab_start = .;
  46. KEEP(*(VSymTab))
  47. __vsymtab_end = .;
  48. . = ALIGN(8);
  49. /* section information for initial. */
  50. . = ALIGN(8);
  51. __rt_init_start = .;
  52. KEEP(*(SORT(.rti_fn*)))
  53. __rt_init_end = .;
  54. . = ALIGN(8);
  55. __rt_utest_tc_tab_start = .;
  56. KEEP(*(UtestTcTab))
  57. __rt_utest_tc_tab_end = .;
  58. . = ALIGN(8);
  59. _etext = .;
  60. } > SRAM
  61. .eh_frame_hdr :
  62. {
  63. *(.eh_frame_hdr)
  64. *(.eh_frame_entry)
  65. } > SRAM
  66. .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } > SRAM
  67. . = ALIGN(8);
  68. .data :
  69. {
  70. *(.data)
  71. *(.data.*)
  72. *(.data1)
  73. *(.data1.*)
  74. . = ALIGN(8);
  75. PROVIDE( __global_pointer$ = . + 0x800 );
  76. *(.sdata)
  77. *(.sdata.*)
  78. } > SRAM
  79. /* stack for dual core */
  80. .stack :
  81. {
  82. . = ALIGN(64);
  83. __stack_start__ = .;
  84. . += __STACKSIZE__;
  85. __stack = .;
  86. __rt_rvstack = .;
  87. } > SRAM
  88. .sbss :
  89. {
  90. __bss_start = .;
  91. *(.sbss)
  92. *(.sbss.*)
  93. *(.dynsbss)
  94. *(.scommon)
  95. } > SRAM
  96. .bss :
  97. {
  98. *(.bss)
  99. *(.bss.*)
  100. *(.dynbss)
  101. *(COMMON)
  102. __bss_end = .;
  103. } > SRAM
  104. _end = .;
  105. /* Stabs debugging sections. */
  106. .stab 0 : { *(.stab) }
  107. .stabstr 0 : { *(.stabstr) }
  108. .stab.excl 0 : { *(.stab.excl) }
  109. .stab.exclstr 0 : { *(.stab.exclstr) }
  110. .stab.index 0 : { *(.stab.index) }
  111. .stab.indexstr 0 : { *(.stab.indexstr) }
  112. .comment 0 : { *(.comment) }
  113. /* DWARF debug sections.
  114. * Symbols in the DWARF debugging sections are relative to the beginning
  115. * of the section so we begin them at 0. */
  116. /* DWARF 1 */
  117. .debug 0 : { *(.debug) }
  118. .line 0 : { *(.line) }
  119. /* GNU DWARF 1 extensions */
  120. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  121. .debug_sfnames 0 : { *(.debug_sfnames) }
  122. /* DWARF 1.1 and DWARF 2 */
  123. .debug_aranges 0 : { *(.debug_aranges) }
  124. .debug_pubnames 0 : { *(.debug_pubnames) }
  125. /* DWARF 2 */
  126. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  127. .debug_abbrev 0 : { *(.debug_abbrev) }
  128. .debug_line 0 : { *(.debug_line) }
  129. .debug_frame 0 : { *(.debug_frame) }
  130. .debug_str 0 : { *(.debug_str) }
  131. .debug_loc 0 : { *(.debug_loc) }
  132. .debug_macinfo 0 : { *(.debug_macinfo) }
  133. /* SGI/MIPS DWARF 2 extensions */
  134. .debug_weaknames 0 : { *(.debug_weaknames) }
  135. .debug_funcnames 0 : { *(.debug_funcnames) }
  136. .debug_typenames 0 : { *(.debug_typenames) }
  137. .debug_varnames 0 : { *(.debug_varnames) }
  138. }