link.lds 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. /*
  2. * linker script for STM32H7S7L8HxH with GNU ld
  3. */
  4. /* Program Entry, set to mark it as "used" and avoid gc */
  5. MEMORY
  6. {
  7. ROM (rx) : ORIGIN =0x70000000,LENGTH =65536K
  8. RAM (rw) : ORIGIN =0x24000000,LENGTH =455K
  9. ITCM (rwx) : ORIGIN = 0x00000000, LENGTH = 64K
  10. }
  11. ENTRY(Reset_Handler)
  12. _system_stack_size = 0x400;
  13. SECTIONS
  14. {
  15. .text :
  16. {
  17. . = ALIGN(4);
  18. _stext = .;
  19. KEEP(*(.isr_vector)) /* Startup code */
  20. . = ALIGN(4);
  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(4);
  30. __fsymtab_start = .;
  31. KEEP(*(FSymTab))
  32. __fsymtab_end = .;
  33. . = ALIGN(4);
  34. __vsymtab_start = .;
  35. KEEP(*(VSymTab))
  36. __vsymtab_end = .;
  37. /* section information for utest */
  38. . = ALIGN(4);
  39. __rt_utest_tc_tab_start = .;
  40. KEEP(*(UtestTcTab))
  41. __rt_utest_tc_tab_end = .;
  42. /* section information for at server */
  43. . = ALIGN(4);
  44. __rtatcmdtab_start = .;
  45. KEEP(*(RtAtCmdTab))
  46. __rtatcmdtab_end = .;
  47. . = ALIGN(4);
  48. /* section information for modules */
  49. . = ALIGN(4);
  50. __rtmsymtab_start = .;
  51. KEEP(*(RTMSymTab))
  52. __rtmsymtab_end = .;
  53. /* section information for initial. */
  54. . = ALIGN(4);
  55. __rt_init_start = .;
  56. KEEP(*(SORT(.rti_fn*)))
  57. __rt_init_end = .;
  58. . = ALIGN(4);
  59. PROVIDE(__ctors_start__ = .);
  60. KEEP (*(SORT(.init_array.*)))
  61. KEEP (*(.init_array))
  62. PROVIDE(__ctors_end__ = .);
  63. . = ALIGN(4);
  64. _etext = .;
  65. } > ROM = 0
  66. /* .ARM.exidx is sorted, so has to go in its own output section. */
  67. __exidx_start = .;
  68. .ARM.exidx :
  69. {
  70. *(.ARM.exidx* .gnu.linkonce.armexidx.*)
  71. /* This is used by the startup in order to initialize the .data secion */
  72. _sidata = .;
  73. } > ROM
  74. __exidx_end = .;
  75. /* .data section which is used for initialized data */
  76. .data : AT (_sidata)
  77. {
  78. . = ALIGN(4);
  79. /* This is used by the startup in order to initialize the .data secion */
  80. _sdata = . ;
  81. *(.data)
  82. *(.data.*)
  83. *(.gnu.linkonce.d*)
  84. PROVIDE(__dtors_start__ = .);
  85. KEEP(*(SORT(.dtors.*)))
  86. KEEP(*(.dtors))
  87. PROVIDE(__dtors_end__ = .);
  88. . = ALIGN(4);
  89. /* This is used by the startup in order to initialize the .data secion */
  90. _edata = . ;
  91. } >RAM
  92. .stack :
  93. {
  94. . = ALIGN(4);
  95. _sstack = .;
  96. . = . + _system_stack_size;
  97. . = ALIGN(4);
  98. _estack = .;
  99. } >RAM
  100. __bss_start = .;
  101. .bss :
  102. {
  103. . = ALIGN(4);
  104. /* This is used by the startup in order to initialize the .bss secion */
  105. _sbss = .;
  106. *(.bss)
  107. *(.bss.*)
  108. *(COMMON)
  109. . = ALIGN(4);
  110. /* This is used by the startup in order to initialize the .bss secion */
  111. _ebss = . ;
  112. *(.bss.init)
  113. } > RAM
  114. __bss_end = .;
  115. _end = .;
  116. /* Stabs debugging sections. */
  117. .stab 0 : { *(.stab) }
  118. .stabstr 0 : { *(.stabstr) }
  119. .stab.excl 0 : { *(.stab.excl) }
  120. .stab.exclstr 0 : { *(.stab.exclstr) }
  121. .stab.index 0 : { *(.stab.index) }
  122. .stab.indexstr 0 : { *(.stab.indexstr) }
  123. .comment 0 : { *(.comment) }
  124. /* DWARF debug sections.
  125. * Symbols in the DWARF debugging sections are relative to the beginning
  126. * of the section so we begin them at 0. */
  127. /* DWARF 1 */
  128. .debug 0 : { *(.debug) }
  129. .line 0 : { *(.line) }
  130. /* GNU DWARF 1 extensions */
  131. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  132. .debug_sfnames 0 : { *(.debug_sfnames) }
  133. /* DWARF 1.1 and DWARF 2 */
  134. .debug_aranges 0 : { *(.debug_aranges) }
  135. .debug_pubnames 0 : { *(.debug_pubnames) }
  136. /* DWARF 2 */
  137. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  138. .debug_abbrev 0 : { *(.debug_abbrev) }
  139. .debug_line 0 : { *(.debug_line) }
  140. .debug_frame 0 : { *(.debug_frame) }
  141. .debug_str 0 : { *(.debug_str) }
  142. .debug_loc 0 : { *(.debug_loc) }
  143. .debug_macinfo 0 : { *(.debug_macinfo) }
  144. /* SGI/MIPS DWARF 2 extensions */
  145. .debug_weaknames 0 : { *(.debug_weaknames) }
  146. .debug_funcnames 0 : { *(.debug_funcnames) }
  147. .debug_typenames 0 : { *(.debug_typenames) }
  148. .debug_varnames 0 : { *(.debug_varnames) }
  149. }