link.lds 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * 2017-5-30 bernard first version
  8. */
  9. OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
  10. OUTPUT_ARCH(arm)
  11. SECTIONS
  12. {
  13. . = 0x00008000;
  14. . = ALIGN(4);
  15. .text :
  16. {
  17. *(.vectors)
  18. *(.text) /* remaining code */
  19. *(.text.*) /* remaining code */
  20. *(.rodata) /* read-only data (constants) */
  21. *(.rodata*)
  22. *(.glue_7)
  23. *(.glue_7t)
  24. *(.gnu.linkonce.t*)
  25. /* section information for finsh shell */
  26. . = ALIGN(4);
  27. __fsymtab_start = .;
  28. KEEP(*(FSymTab))
  29. __fsymtab_end = .;
  30. . = ALIGN(4);
  31. __vsymtab_start = .;
  32. KEEP(*(VSymTab))
  33. __vsymtab_end = .;
  34. . = ALIGN(4);
  35. /* section information for initial. */
  36. . = ALIGN(4);
  37. __rt_init_start = .;
  38. KEEP(*(SORT(.rti_fn*)))
  39. __rt_init_end = .;
  40. . = ALIGN(4);
  41. . = ALIGN(4);
  42. _etext = .;
  43. }
  44. .eh_frame_hdr :
  45. {
  46. *(.eh_frame_hdr)
  47. *(.eh_frame_entry)
  48. }
  49. .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
  50. . = ALIGN(4);
  51. .data :
  52. {
  53. *(.data)
  54. *(.data.*)
  55. *(.data1)
  56. *(.data1.*)
  57. . = ALIGN(8);
  58. _gp = ABSOLUTE(.); /* Base of small data */
  59. *(.sdata)
  60. *(.sdata.*)
  61. }
  62. . = ALIGN(4);
  63. .ctors :
  64. {
  65. PROVIDE(__ctors_start__ = .);
  66. /* new GCC version uses .init_array */
  67. KEEP(*(SORT(.init_array.*)))
  68. KEEP(*(.init_array))
  69. PROVIDE(__ctors_end__ = .);
  70. }
  71. .dtors :
  72. {
  73. PROVIDE(__dtors_start__ = .);
  74. KEEP(*(SORT(.dtors.*)))
  75. KEEP(*(.dtors))
  76. PROVIDE(__dtors_end__ = .);
  77. }
  78. . = ALIGN(4);
  79. .bss :
  80. {
  81. PROVIDE(__bss_start = .);
  82. *(.bss)
  83. *(.bss.*)
  84. *(.dynbss)
  85. *(COMMON)
  86. PROVIDE(__bss_end = .);
  87. }
  88. _end = .;
  89. /* Stabs debugging sections. */
  90. .stab 0 : { *(.stab) }
  91. .stabstr 0 : { *(.stabstr) }
  92. .stab.excl 0 : { *(.stab.excl) }
  93. .stab.exclstr 0 : { *(.stab.exclstr) }
  94. .stab.index 0 : { *(.stab.index) }
  95. .stab.indexstr 0 : { *(.stab.indexstr) }
  96. .comment 0 : { *(.comment) }
  97. /* DWARF debug sections.
  98. * Symbols in the DWARF debugging sections are relative to the beginning
  99. * of the section so we begin them at 0. */
  100. /* DWARF 1 */
  101. .debug 0 : { *(.debug) }
  102. .line 0 : { *(.line) }
  103. /* GNU DWARF 1 extensions */
  104. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  105. .debug_sfnames 0 : { *(.debug_sfnames) }
  106. /* DWARF 1.1 and DWARF 2 */
  107. .debug_aranges 0 : { *(.debug_aranges) }
  108. .debug_pubnames 0 : { *(.debug_pubnames) }
  109. /* DWARF 2 */
  110. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  111. .debug_abbrev 0 : { *(.debug_abbrev) }
  112. .debug_line 0 : { *(.debug_line) }
  113. .debug_frame 0 : { *(.debug_frame) }
  114. .debug_str 0 : { *(.debug_str) }
  115. .debug_loc 0 : { *(.debug_loc) }
  116. .debug_macinfo 0 : { *(.debug_macinfo) }
  117. /* SGI/MIPS DWARF 2 extensions */
  118. .debug_weaknames 0 : { *(.debug_weaknames) }
  119. .debug_funcnames 0 : { *(.debug_funcnames) }
  120. .debug_typenames 0 : { *(.debug_typenames) }
  121. .debug_varnames 0 : { *(.debug_varnames) }
  122. }