link.lds 3.7 KB

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