link.lds 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. /*
  2. * File : link.lds
  3. * COPYRIGHT (C) 2017, 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. * 2017-5-30 bernard first version
  21. */
  22. /* _EL1_STACK_SIZE = DEFINED(_EL1_STACK_SIZE) ? _EL1_STACK_SIZE : 0x20000; */
  23. SECTIONS
  24. {
  25. . = 0x8000;
  26. . = ALIGN(4096);
  27. .text :
  28. {
  29. KEEP(*(.text.entrypoint)) /* The entry point */
  30. *(.vectors)
  31. *(.text) /* remaining code */
  32. *(.text.*) /* remaining code */
  33. *(.rodata) /* read-only data (constants) */
  34. *(.rodata*)
  35. *(.glue_7)
  36. *(.glue_7t)
  37. *(.gnu.linkonce.t*)
  38. *(COMMON)
  39. /* section information for finsh shell */
  40. . = ALIGN(16);
  41. __fsymtab_start = .;
  42. KEEP(*(FSymTab))
  43. __fsymtab_end = .;
  44. . = ALIGN(16);
  45. __vsymtab_start = .;
  46. KEEP(*(VSymTab))
  47. __vsymtab_end = .;
  48. . = ALIGN(16);
  49. /* section information for initial. */
  50. . = ALIGN(16);
  51. __rt_init_start = .;
  52. KEEP(*(SORT(.rti_fn*)))
  53. __rt_init_end = .;
  54. . = ALIGN(16);
  55. . = ALIGN(16);
  56. _etext = .;
  57. }
  58. __exidx_start = .;
  59. .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) }
  60. __exidx_end = .;
  61. __rodata_start = .;
  62. .rodata : { *(.rodata) *(.rodata.*) }
  63. __rodata_end = .;
  64. .eh_frame_hdr :
  65. {
  66. *(.eh_frame_hdr)
  67. *(.eh_frame_entry)
  68. }
  69. .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
  70. . = ALIGN(16);
  71. .data :
  72. {
  73. *(.data)
  74. *(.data.*)
  75. *(.data1)
  76. *(.data1.*)
  77. . = ALIGN(16);
  78. _gp = ABSOLUTE(.); /* Base of small data */
  79. *(.sdata)
  80. *(.sdata.*)
  81. }
  82. . = ALIGN(16);
  83. .ctors :
  84. {
  85. PROVIDE(__ctors_start__ = .);
  86. KEEP(*(SORT(.ctors.*)))
  87. KEEP(*(.ctors))
  88. PROVIDE(__ctors_end__ = .);
  89. }
  90. .dtors :
  91. {
  92. PROVIDE(__dtors_start__ = .);
  93. KEEP(*(SORT(.dtors.*)))
  94. KEEP(*(.dtors))
  95. PROVIDE(__dtors_end__ = .);
  96. }
  97. . = ALIGN(16);
  98. .bss :
  99. {
  100. PROVIDE(__bss_start = .);
  101. *(.bss)
  102. *(.bss.*)
  103. *(.dynbss)
  104. PROVIDE(__bss_end = .);
  105. }
  106. _end = .;
  107. /* Stabs debugging sections. */
  108. .stab 0 : { *(.stab) }
  109. .stabstr 0 : { *(.stabstr) }
  110. .stab.excl 0 : { *(.stab.excl) }
  111. .stab.exclstr 0 : { *(.stab.exclstr) }
  112. .stab.index 0 : { *(.stab.index) }
  113. .stab.indexstr 0 : { *(.stab.indexstr) }
  114. .comment 0 : { *(.comment) }
  115. /* DWARF debug sections.
  116. * Symbols in the DWARF debugging sections are relative to the beginning
  117. * of the section so we begin them at 0. */
  118. /* DWARF 1 */
  119. .debug 0 : { *(.debug) }
  120. .line 0 : { *(.line) }
  121. /* GNU DWARF 1 extensions */
  122. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  123. .debug_sfnames 0 : { *(.debug_sfnames) }
  124. /* DWARF 1.1 and DWARF 2 */
  125. .debug_aranges 0 : { *(.debug_aranges) }
  126. .debug_pubnames 0 : { *(.debug_pubnames) }
  127. /* DWARF 2 */
  128. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  129. .debug_abbrev 0 : { *(.debug_abbrev) }
  130. .debug_line 0 : { *(.debug_line) }
  131. .debug_frame 0 : { *(.debug_frame) }
  132. .debug_str 0 : { *(.debug_str) }
  133. .debug_loc 0 : { *(.debug_loc) }
  134. .debug_macinfo 0 : { *(.debug_macinfo) }
  135. /* SGI/MIPS DWARF 2 extensions */
  136. .debug_weaknames 0 : { *(.debug_weaknames) }
  137. .debug_funcnames 0 : { *(.debug_funcnames) }
  138. .debug_typenames 0 : { *(.debug_typenames) }
  139. .debug_varnames 0 : { *(.debug_varnames) }
  140. }
  141. __bss_size = (__bss_end - __bss_start)>>3;