x1000_ram.lds 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. /*
  2. * Copyright (c) 2006-2019, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2015-12-12 bernard first version
  9. * 2019-04-04 Jean-Luc add support for large number of sections.
  10. */
  11. OUTPUT_FORMAT("elf32-tradlittlemips", "elf32-tradlittlemips", "elf32-tradlittlemips")
  12. OUTPUT_ARCH(mips)
  13. MEMORY
  14. {
  15. /* 16M SDRAM */
  16. DRAM : ORIGIN = 0x80800000, LENGTH = 0x01800000
  17. /* 16K SRAM */
  18. IRAM : ORIGIN = 0x80000000, LENGTH = 0x00004000
  19. }
  20. ENTRY(_start)
  21. SECTIONS
  22. {
  23. .start :
  24. {
  25. *(.start);
  26. } > DRAM
  27. . = ALIGN(4);
  28. .text :
  29. {
  30. *(.text.unlikely .text.*_unlikely .text.unlikely.*)
  31. *(.text.exit .text.exit.*)
  32. *(.text.startup .text.startup.*)
  33. *(.text.hot .text.hot.*)
  34. *(.text .stub .text.* .gnu.linkonce.t.*)
  35. *(.text) /* remaining code */
  36. *(.text.*) /* remaining code */
  37. *(.rodata) /* read-only data (constants) */
  38. *(.rodata*)
  39. *(.glue_7)
  40. *(.glue_7t)
  41. *(.gnu.linkonce.t*)
  42. /* section information for finsh shell */
  43. . = ALIGN(4);
  44. __fsymtab_start = .;
  45. KEEP(*(FSymTab))
  46. __fsymtab_end = .;
  47. . = ALIGN(4);
  48. __vsymtab_start = .;
  49. KEEP(*(VSymTab))
  50. __vsymtab_end = .;
  51. . = ALIGN(4);
  52. /* section information for initial. */
  53. . = ALIGN(4);
  54. __rt_init_start = .;
  55. KEEP(*(SORT(.rti_fn*)))
  56. __rt_init_end = .;
  57. . = ALIGN(4);
  58. /* section information for modules */
  59. . = ALIGN(4);
  60. __rtmsymtab_start = .;
  61. KEEP(*(RTMSymTab))
  62. __rtmsymtab_end = .;
  63. . = ALIGN(4);
  64. _etext = .;
  65. } > DRAM
  66. .eh_frame_hdr :
  67. {
  68. *(.eh_frame_hdr)
  69. *(.eh_frame_entry)
  70. *(.eh_frame_entry.*)
  71. } > DRAM
  72. .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } > DRAM
  73. . = ALIGN(4);
  74. .gnu_extab :
  75. {
  76. *(.gnu_extab.*)
  77. } > DRAM
  78. . = ALIGN(4);
  79. .ctors :
  80. {
  81. PROVIDE(__ctors_start__ = .);
  82. KEEP(*(SORT(.ctors.*)))
  83. KEEP(*(.ctors))
  84. PROVIDE(__ctors_end__ = .);
  85. } > DRAM
  86. .dtors :
  87. {
  88. PROVIDE(__dtors_start__ = .);
  89. KEEP(*(SORT(.dtors.*)))
  90. KEEP(*(.dtors))
  91. PROVIDE(__dtors_end__ = .);
  92. } > DRAM
  93. .data :
  94. {
  95. *(.data)
  96. *(.data.*)
  97. *(.data1)
  98. *(.data1.*)
  99. . = ALIGN(8);
  100. _gp = ABSOLUTE(.); /* Base of small data */
  101. *(.sdata)
  102. *(.sdata.*)
  103. } > DRAM
  104. . = ALIGN(4);
  105. _iramat = .;
  106. .iram : AT(_iramat)
  107. {
  108. _iramstart = .;
  109. *(.vectors.1);
  110. . = 0x100;
  111. *(.vectors.2);
  112. . = 0x180;
  113. *(.vectors.3);
  114. . = 0x200;
  115. *(.vectors.4);
  116. *(.vectors);
  117. *(.icode);
  118. *(.irodata);
  119. *(.idata);
  120. KEEP(*(.vectors*))
  121. _iramend = .;
  122. } > IRAM
  123. _iramcopy = LOADADDR(.iram);
  124. .sbss :
  125. {
  126. __bss_start = .;
  127. *(.sbss)
  128. *(.sbss.*)
  129. *(.dynsbss)
  130. *(.scommon)
  131. } > DRAM
  132. .bss :
  133. {
  134. *(.bss)
  135. *(.bss.*)
  136. *(.dynbss)
  137. *(COMMON)
  138. __bss_end = .;
  139. } > DRAM
  140. _end = .;
  141. /* Stabs debugging sections. */
  142. .stab 0 : { *(.stab) }
  143. .stabstr 0 : { *(.stabstr) }
  144. .stab.excl 0 : { *(.stab.excl) }
  145. .stab.exclstr 0 : { *(.stab.exclstr) }
  146. .stab.index 0 : { *(.stab.index) }
  147. .stab.indexstr 0 : { *(.stab.indexstr) }
  148. .comment 0 : { *(.comment) }
  149. /* DWARF debug sections.
  150. * Symbols in the DWARF debugging sections are relative to the beginning
  151. * of the section so we begin them at 0. */
  152. /* DWARF 1 */
  153. .debug 0 : { *(.debug) }
  154. .line 0 : { *(.line) }
  155. /* GNU DWARF 1 extensions */
  156. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  157. .debug_sfnames 0 : { *(.debug_sfnames) }
  158. /* DWARF 1.1 and DWARF 2 */
  159. .debug_aranges 0 : { *(.debug_aranges) }
  160. .debug_pubnames 0 : { *(.debug_pubnames) }
  161. /* DWARF 2 */
  162. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  163. .debug_abbrev 0 : { *(.debug_abbrev) }
  164. .debug_line 0 : { *(.debug_line) }
  165. .debug_frame 0 : { *(.debug_frame) }
  166. .debug_str 0 : { *(.debug_str) }
  167. .debug_loc 0 : { *(.debug_loc) }
  168. .debug_macinfo 0 : { *(.debug_macinfo) }
  169. /* SGI/MIPS DWARF 2 extensions */
  170. .debug_weaknames 0 : { *(.debug_weaknames) }
  171. .debug_funcnames 0 : { *(.debug_funcnames) }
  172. .debug_typenames 0 : { *(.debug_typenames) }
  173. .debug_varnames 0 : { *(.debug_varnames) }
  174. }