link.lds 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
  23. OUTPUT_ARCH(arm)
  24. SECTIONS
  25. {
  26. . = 0x00008000;
  27. . = ALIGN(4);
  28. .text :
  29. {
  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. /* section information for finsh shell */
  39. . = ALIGN(4);
  40. __fsymtab_start = .;
  41. KEEP(*(FSymTab))
  42. __fsymtab_end = .;
  43. . = ALIGN(4);
  44. __vsymtab_start = .;
  45. KEEP(*(VSymTab))
  46. __vsymtab_end = .;
  47. . = ALIGN(4);
  48. /* section information for initial. */
  49. . = ALIGN(4);
  50. __rt_init_start = .;
  51. KEEP(*(SORT(.rti_fn*)))
  52. __rt_init_end = .;
  53. . = ALIGN(4);
  54. . = ALIGN(4);
  55. _etext = .;
  56. }
  57. .eh_frame_hdr :
  58. {
  59. *(.eh_frame_hdr)
  60. *(.eh_frame_entry)
  61. }
  62. .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
  63. . = ALIGN(4);
  64. .data :
  65. {
  66. *(.data)
  67. *(.data.*)
  68. *(.data1)
  69. *(.data1.*)
  70. . = ALIGN(8);
  71. _gp = ABSOLUTE(.); /* Base of small data */
  72. *(.sdata)
  73. *(.sdata.*)
  74. }
  75. . = ALIGN(4);
  76. .ctors :
  77. {
  78. PROVIDE(__ctors_start__ = .);
  79. KEEP(*(SORT(.ctors.*)))
  80. KEEP(*(.ctors))
  81. PROVIDE(__ctors_end__ = .);
  82. }
  83. .dtors :
  84. {
  85. PROVIDE(__dtors_start__ = .);
  86. KEEP(*(SORT(.dtors.*)))
  87. KEEP(*(.dtors))
  88. PROVIDE(__dtors_end__ = .);
  89. }
  90. . = ALIGN(4);
  91. .bss :
  92. {
  93. PROVIDE(__bss_start = .);
  94. *(.bss)
  95. *(.bss.*)
  96. *(.dynbss)
  97. *(COMMON)
  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. }