link.lds 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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. . = 0x80000;
  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. .eh_frame_hdr :
  59. {
  60. *(.eh_frame_hdr)
  61. *(.eh_frame_entry)
  62. }
  63. .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
  64. . = ALIGN(16);
  65. .data :
  66. {
  67. *(.data)
  68. *(.data.*)
  69. *(.data1)
  70. *(.data1.*)
  71. . = ALIGN(16);
  72. _gp = ABSOLUTE(.); /* Base of small data */
  73. *(.sdata)
  74. *(.sdata.*)
  75. }
  76. . = ALIGN(16);
  77. .ctors :
  78. {
  79. PROVIDE(__ctors_start__ = .);
  80. KEEP(*(SORT(.ctors.*)))
  81. KEEP(*(.ctors))
  82. PROVIDE(__ctors_end__ = .);
  83. }
  84. .dtors :
  85. {
  86. PROVIDE(__dtors_start__ = .);
  87. KEEP(*(SORT(.dtors.*)))
  88. KEEP(*(.dtors))
  89. PROVIDE(__dtors_end__ = .);
  90. }
  91. . = ALIGN(16);
  92. .bss :
  93. {
  94. PROVIDE(__bss_start = .);
  95. *(.bss)
  96. *(.bss.*)
  97. *(.dynbss)
  98. PROVIDE(__bss_end = .);
  99. }
  100. _end = .;
  101. /* Stabs debugging sections. */
  102. .stab 0 : { *(.stab) }
  103. .stabstr 0 : { *(.stabstr) }
  104. .stab.excl 0 : { *(.stab.excl) }
  105. .stab.exclstr 0 : { *(.stab.exclstr) }
  106. .stab.index 0 : { *(.stab.index) }
  107. .stab.indexstr 0 : { *(.stab.indexstr) }
  108. .comment 0 : { *(.comment) }
  109. /* DWARF debug sections.
  110. * Symbols in the DWARF debugging sections are relative to the beginning
  111. * of the section so we begin them at 0. */
  112. /* DWARF 1 */
  113. .debug 0 : { *(.debug) }
  114. .line 0 : { *(.line) }
  115. /* GNU DWARF 1 extensions */
  116. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  117. .debug_sfnames 0 : { *(.debug_sfnames) }
  118. /* DWARF 1.1 and DWARF 2 */
  119. .debug_aranges 0 : { *(.debug_aranges) }
  120. .debug_pubnames 0 : { *(.debug_pubnames) }
  121. /* DWARF 2 */
  122. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  123. .debug_abbrev 0 : { *(.debug_abbrev) }
  124. .debug_line 0 : { *(.debug_line) }
  125. .debug_frame 0 : { *(.debug_frame) }
  126. .debug_str 0 : { *(.debug_str) }
  127. .debug_loc 0 : { *(.debug_loc) }
  128. .debug_macinfo 0 : { *(.debug_macinfo) }
  129. /* SGI/MIPS DWARF 2 extensions */
  130. .debug_weaknames 0 : { *(.debug_weaknames) }
  131. .debug_funcnames 0 : { *(.debug_funcnames) }
  132. .debug_typenames 0 : { *(.debug_typenames) }
  133. .debug_varnames 0 : { *(.debug_varnames) }
  134. }
  135. __bss_size = (__bss_end - __bss_start)>>3;