x1000_ram.lds 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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. . = 0x80800000 ;
  35. .start :
  36. {
  37. *(.start);
  38. } > DRAM
  39. . = ALIGN(4);
  40. .text :
  41. {
  42. *(.text) /* remaining code */
  43. *(.text.*) /* remaining code */
  44. *(.rodata) /* read-only data (constants) */
  45. *(.rodata*)
  46. *(.glue_7)
  47. *(.glue_7t)
  48. *(.gnu.linkonce.t*)
  49. /* section information for finsh shell */
  50. . = ALIGN(4);
  51. __fsymtab_start = .;
  52. KEEP(*(FSymTab))
  53. __fsymtab_end = .;
  54. . = ALIGN(4);
  55. __vsymtab_start = .;
  56. KEEP(*(VSymTab))
  57. __vsymtab_end = .;
  58. . = ALIGN(4);
  59. /* section information for initial. */
  60. . = ALIGN(4);
  61. __rt_init_start = .;
  62. KEEP(*(SORT(.rti_fn*)))
  63. __rt_init_end = .;
  64. . = ALIGN(4);
  65. . = ALIGN(4);
  66. _etext = .;
  67. } > DRAM
  68. .eh_frame_hdr :
  69. {
  70. *(.eh_frame_hdr)
  71. *(.eh_frame_entry)
  72. } > DRAM
  73. .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } > DRAM
  74. . = ALIGN(4);
  75. .data :
  76. {
  77. *(.data)
  78. *(.data.*)
  79. *(.data1)
  80. *(.data1.*)
  81. . = ALIGN(8);
  82. _gp = ABSOLUTE(.); /* Base of small data */
  83. *(.sdata)
  84. *(.sdata.*)
  85. } > DRAM
  86. . = ALIGN(4);
  87. _iramat = .;
  88. .iram : AT(_iramat)
  89. {
  90. _iramstart = .;
  91. *(.vectors.1);
  92. . = 0x100;
  93. *(.vectors.2);
  94. . = 0x180;
  95. *(.vectors.3);
  96. . = 0x200;
  97. *(.vectors.4);
  98. *(.vectors);
  99. *(.icode);
  100. *(.irodata);
  101. *(.idata);
  102. KEEP(*(.vectors*))
  103. _iramend = .;
  104. } > IRAM
  105. _iramcopy = LOADADDR(.iram);
  106. .sbss :
  107. {
  108. __bss_start = .;
  109. *(.sbss)
  110. *(.sbss.*)
  111. *(.dynsbss)
  112. *(.scommon)
  113. } > DRAM
  114. .bss :
  115. {
  116. *(.bss)
  117. *(.bss.*)
  118. *(.dynbss)
  119. *(COMMON)
  120. __bss_end = .;
  121. } > DRAM
  122. _end = .;
  123. /* Stabs debugging sections. */
  124. .stab 0 : { *(.stab) }
  125. .stabstr 0 : { *(.stabstr) }
  126. .stab.excl 0 : { *(.stab.excl) }
  127. .stab.exclstr 0 : { *(.stab.exclstr) }
  128. .stab.index 0 : { *(.stab.index) }
  129. .stab.indexstr 0 : { *(.stab.indexstr) }
  130. .comment 0 : { *(.comment) }
  131. /* DWARF debug sections.
  132. * Symbols in the DWARF debugging sections are relative to the beginning
  133. * of the section so we begin them at 0. */
  134. /* DWARF 1 */
  135. .debug 0 : { *(.debug) }
  136. .line 0 : { *(.line) }
  137. /* GNU DWARF 1 extensions */
  138. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  139. .debug_sfnames 0 : { *(.debug_sfnames) }
  140. /* DWARF 1.1 and DWARF 2 */
  141. .debug_aranges 0 : { *(.debug_aranges) }
  142. .debug_pubnames 0 : { *(.debug_pubnames) }
  143. /* DWARF 2 */
  144. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  145. .debug_abbrev 0 : { *(.debug_abbrev) }
  146. .debug_line 0 : { *(.debug_line) }
  147. .debug_frame 0 : { *(.debug_frame) }
  148. .debug_str 0 : { *(.debug_str) }
  149. .debug_loc 0 : { *(.debug_loc) }
  150. .debug_macinfo 0 : { *(.debug_macinfo) }
  151. /* SGI/MIPS DWARF 2 extensions */
  152. .debug_weaknames 0 : { *(.debug_weaknames) }
  153. .debug_funcnames 0 : { *(.debug_funcnames) }
  154. .debug_typenames 0 : { *(.debug_typenames) }
  155. .debug_varnames 0 : { *(.debug_varnames) }
  156. }