x1000_ram.lds 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. /*
  2. * File : x1000_ram.lds
  3. * COPYRIGHT (C) 2015, RT-Thread Development Team
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along
  16. * with this program; if not, write to the Free Software Foundation, Inc.,
  17. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  18. *
  19. * Change Logs:
  20. * 2015-12-12 bernard first version
  21. */
  22. OUTPUT_FORMAT("elf32-tradlittlemips", "elf32-tradlittlemips", "elf32-tradlittlemips")
  23. OUTPUT_ARCH(mips)
  24. MEMORY
  25. {
  26. /* 16M SDRAM */
  27. DRAM : ORIGIN = 0x80800000, LENGTH = 0x01800000
  28. /* 16K SRAM */
  29. IRAM : ORIGIN = 0x80000000, LENGTH = 0x00004000
  30. }
  31. ENTRY(_start)
  32. SECTIONS
  33. {
  34. .start :
  35. {
  36. *(.start);
  37. } > DRAM
  38. . = ALIGN(4);
  39. .text :
  40. {
  41. *(.text) /* remaining code */
  42. *(.text.*) /* remaining code */
  43. *(.rodata) /* read-only data (constants) */
  44. *(.rodata*)
  45. *(.glue_7)
  46. *(.glue_7t)
  47. *(.gnu.linkonce.t*)
  48. /* section information for finsh shell */
  49. . = ALIGN(4);
  50. __fsymtab_start = .;
  51. KEEP(*(FSymTab))
  52. __fsymtab_end = .;
  53. . = ALIGN(4);
  54. __vsymtab_start = .;
  55. KEEP(*(VSymTab))
  56. __vsymtab_end = .;
  57. . = ALIGN(4);
  58. /* section information for initial. */
  59. . = ALIGN(4);
  60. __rt_init_start = .;
  61. KEEP(*(SORT(.rti_fn*)))
  62. __rt_init_end = .;
  63. . = ALIGN(4);
  64. /* section information for modules */
  65. . = ALIGN(4);
  66. __rtmsymtab_start = .;
  67. KEEP(*(RTMSymTab))
  68. __rtmsymtab_end = .;
  69. . = ALIGN(4);
  70. _etext = .;
  71. } > DRAM
  72. .eh_frame_hdr :
  73. {
  74. *(.eh_frame_hdr)
  75. *(.eh_frame_entry)
  76. *(.eh_frame_entry.*)
  77. } > DRAM
  78. .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } > DRAM
  79. . = ALIGN(4);
  80. .ctors :
  81. {
  82. PROVIDE(__ctors_start__ = .);
  83. KEEP(*(SORT(.ctors.*)))
  84. KEEP(*(.ctors))
  85. PROVIDE(__ctors_end__ = .);
  86. } > DRAM
  87. .dtors :
  88. {
  89. PROVIDE(__dtors_start__ = .);
  90. KEEP(*(SORT(.dtors.*)))
  91. KEEP(*(.dtors))
  92. PROVIDE(__dtors_end__ = .);
  93. } > DRAM
  94. .data :
  95. {
  96. *(.data)
  97. *(.data.*)
  98. *(.data1)
  99. *(.data1.*)
  100. . = ALIGN(8);
  101. _gp = ABSOLUTE(.); /* Base of small data */
  102. *(.sdata)
  103. *(.sdata.*)
  104. } > DRAM
  105. . = ALIGN(4);
  106. _iramat = .;
  107. .iram : AT(_iramat)
  108. {
  109. _iramstart = .;
  110. *(.vectors.1);
  111. . = 0x100;
  112. *(.vectors.2);
  113. . = 0x180;
  114. *(.vectors.3);
  115. . = 0x200;
  116. *(.vectors.4);
  117. *(.vectors);
  118. *(.icode);
  119. *(.irodata);
  120. *(.idata);
  121. KEEP(*(.vectors*))
  122. _iramend = .;
  123. } > IRAM
  124. _iramcopy = LOADADDR(.iram);
  125. .sbss :
  126. {
  127. __bss_start = .;
  128. *(.sbss)
  129. *(.sbss.*)
  130. *(.dynsbss)
  131. *(.scommon)
  132. } > DRAM
  133. .bss :
  134. {
  135. *(.bss)
  136. *(.bss.*)
  137. *(.dynbss)
  138. *(COMMON)
  139. __bss_end = .;
  140. } > DRAM
  141. _end = .;
  142. /* Stabs debugging sections. */
  143. .stab 0 : { *(.stab) }
  144. .stabstr 0 : { *(.stabstr) }
  145. .stab.excl 0 : { *(.stab.excl) }
  146. .stab.exclstr 0 : { *(.stab.exclstr) }
  147. .stab.index 0 : { *(.stab.index) }
  148. .stab.indexstr 0 : { *(.stab.indexstr) }
  149. .comment 0 : { *(.comment) }
  150. /* DWARF debug sections.
  151. * Symbols in the DWARF debugging sections are relative to the beginning
  152. * of the section so we begin them at 0. */
  153. /* DWARF 1 */
  154. .debug 0 : { *(.debug) }
  155. .line 0 : { *(.line) }
  156. /* GNU DWARF 1 extensions */
  157. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  158. .debug_sfnames 0 : { *(.debug_sfnames) }
  159. /* DWARF 1.1 and DWARF 2 */
  160. .debug_aranges 0 : { *(.debug_aranges) }
  161. .debug_pubnames 0 : { *(.debug_pubnames) }
  162. /* DWARF 2 */
  163. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  164. .debug_abbrev 0 : { *(.debug_abbrev) }
  165. .debug_line 0 : { *(.debug_line) }
  166. .debug_frame 0 : { *(.debug_frame) }
  167. .debug_str 0 : { *(.debug_str) }
  168. .debug_loc 0 : { *(.debug_loc) }
  169. .debug_macinfo 0 : { *(.debug_macinfo) }
  170. /* SGI/MIPS DWARF 2 extensions */
  171. .debug_weaknames 0 : { *(.debug_weaknames) }
  172. .debug_funcnames 0 : { *(.debug_funcnames) }
  173. .debug_typenames 0 : { *(.debug_typenames) }
  174. .debug_varnames 0 : { *(.debug_varnames) }
  175. }