link_smart.lds 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2021-09-09 linzhenxing first version
  9. */
  10. OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
  11. OUTPUT_ARCH(arm)
  12. /* _EL1_STACK_SIZE = DEFINED(_EL1_STACK_SIZE) ? _EL1_STACK_SIZE : 0x20000; */
  13. SECTIONS
  14. {
  15. . = 0xc0001000;
  16. . = ALIGN(4096);
  17. .text :
  18. {
  19. KEEP(*(.text.entrypoint)) /* The entry point */
  20. *(.vectors)
  21. *(.text) /* remaining code */
  22. *(.text.*) /* remaining code */
  23. *(.rodata) /* read-only data (constants) */
  24. *(.rodata*)
  25. *(.glue_7)
  26. *(.glue_7t)
  27. *(.gnu.linkonce.t*)
  28. /* section information for finsh shell */
  29. . = ALIGN(16);
  30. __fsymtab_start = .;
  31. KEEP(*(FSymTab))
  32. __fsymtab_end = .;
  33. . = ALIGN(16);
  34. __vsymtab_start = .;
  35. KEEP(*(VSymTab))
  36. __vsymtab_end = .;
  37. . = ALIGN(16);
  38. /* section information for initial. */
  39. . = ALIGN(16);
  40. __rt_init_start = .;
  41. KEEP(*(SORT(.rti_fn*)))
  42. __rt_init_end = .;
  43. . = ALIGN(16);
  44. /* section information for uRPC */
  45. . = ALIGN(4);
  46. __uRPCSvcTab_start = .;
  47. KEEP(*(uRPCSvcTab))
  48. __uRPCSvcTab_end = .;
  49. . = ALIGN(16);
  50. _etext = .;
  51. }
  52. .ARM.exidx : {
  53. __exidx_start = .;
  54. *(.ARM.exidx* .gnu.linkonce.armexidx.*)
  55. __exidx_end = .;
  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(16);
  64. .data :
  65. {
  66. *(.data)
  67. *(.data.*)
  68. *(.data1)
  69. *(.data1.*)
  70. . = ALIGN(16);
  71. _gp = ABSOLUTE(.); /* Base of small data */
  72. *(.sdata)
  73. *(.sdata.*)
  74. }
  75. . = ALIGN(16);
  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(16);
  91. .bss :
  92. {
  93. PROVIDE(__bss_start = .);
  94. *(.bss)
  95. *(.bss.*)
  96. *(.dynbss)
  97. *(COMMON)
  98. PROVIDE(__bss_end = .);
  99. }
  100. /* Stabs debugging sections. */
  101. .stab 0 : { *(.stab) }
  102. .stabstr 0 : { *(.stabstr) }
  103. .stab.excl 0 : { *(.stab.excl) }
  104. .stab.exclstr 0 : { *(.stab.exclstr) }
  105. .stab.index 0 : { *(.stab.index) }
  106. .stab.indexstr 0 : { *(.stab.indexstr) }
  107. .comment 0 : { *(.comment) }
  108. _end = .;
  109. }
  110. __bss_size = (__bss_end - __bss_start)>>3;