link.lds 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /* Program Entry, set to mark it as "used" and avoid gc */
  2. MEMORY
  3. {
  4. RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 640K
  5. FLASH (rx) : ORIGIN = 0x1010000, LENGTH = 3008K
  6. }
  7. ENTRY(Reset_Handler)
  8. _system_stack_size = 0x4000;
  9. SECTIONS
  10. {
  11. .app_info :
  12. {
  13. . = ALIGN(512);
  14. KEEP(*(.app_info))
  15. . = ALIGN(512);
  16. } >FLASH
  17. .text :
  18. {
  19. . = ALIGN(4);
  20. __isr_start_address = .;
  21. _stext = .;
  22. KEEP(*(.isr_vector)) /* Startup code */
  23. . = ALIGN(4);
  24. *startup_gcc.o(.text .text.*)
  25. *(.text) /* remaining code */
  26. *(.text.*) /* remaining code */
  27. *(.rodata) /* read-only data (constants) */
  28. *(.rodata*)
  29. *(.glue_7)
  30. *(.glue_7t)
  31. *(.gnu.linkonce.t*)
  32. /* section information for finsh shell */
  33. . = ALIGN(4);
  34. __fsymtab_start = .;
  35. KEEP(*(FSymTab))
  36. __fsymtab_end = .;
  37. . = ALIGN(4);
  38. __vsymtab_start = .;
  39. KEEP(*(VSymTab))
  40. __vsymtab_end = .;
  41. /* section information for initial. */
  42. . = ALIGN(4);
  43. __rt_init_start = .;
  44. KEEP(*(SORT(.rti_fn*)))
  45. __rt_init_end = .;
  46. . = ALIGN(4);
  47. PROVIDE(__ctors_start__ = .);
  48. KEEP (*(SORT(.init_array.*)))
  49. KEEP (*(.init_array))
  50. PROVIDE(__ctors_end__ = .);
  51. . = ALIGN(4);
  52. _etext = .;
  53. } > FLASH
  54. /* .ARM.exidx is sorted, so has to go in its own output section. */
  55. __exidx_start = .;
  56. .ARM.exidx :
  57. {
  58. *(.ARM.exidx* .gnu.linkonce.armexidx.*)
  59. /* This is used by the startup in order to initialize the .data secion */
  60. _sidata = .;
  61. } > FLASH
  62. __exidx_end = .;
  63. /* .data section which is used for initialized data */
  64. .data : AT (_sidata)
  65. {
  66. . = ALIGN(4);
  67. /* This is used by the startup in order to initialize the .data secion */
  68. _sdata = . ;
  69. *(.data)
  70. *(.data.*)
  71. *(.gnu.linkonce.d*)
  72. *(.RamFunc) /* .RamFunc sections */
  73. *(.RamFunc*) /* .RamFunc* sections */
  74. . = ALIGN(4);
  75. /* This is used by the startup in order to initialize the .data secion */
  76. _edata = . ;
  77. } >RAM
  78. .stack :
  79. {
  80. . = ALIGN(4);
  81. _sstack = .;
  82. . = . + _system_stack_size;
  83. . = ALIGN(4);
  84. _estack = .;
  85. } >RAM
  86. __bss_start = .;
  87. .bss :
  88. {
  89. . = ALIGN(4);
  90. /* This is used by the startup in order to initialize the .bss secion */
  91. _sbss = .;
  92. *(.bss)
  93. *(.bss.*)
  94. *(COMMON)
  95. . = ALIGN(4);
  96. /* This is used by the startup in order to initialize the .bss secion */
  97. _ebss = . ;
  98. *(.bss.init)
  99. } > RAM
  100. __bss_end = .;
  101. _end = .;
  102. /* Stabs debugging sections. */
  103. .stab 0 : { *(.stab) }
  104. .stabstr 0 : { *(.stabstr) }
  105. .stab.excl 0 : { *(.stab.excl) }
  106. .stab.exclstr 0 : { *(.stab.exclstr) }
  107. .stab.index 0 : { *(.stab.index) }
  108. .stab.indexstr 0 : { *(.stab.indexstr) }
  109. .comment 0 : { *(.comment) }
  110. /* DWARF debug sections.
  111. * Symbols in the DWARF debugging sections are relative to the beginning
  112. * of the section so we begin them at 0. */
  113. /* DWARF 1 */
  114. .debug 0 : { *(.debug) }
  115. .line 0 : { *(.line) }
  116. /* GNU DWARF 1 extensions */
  117. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  118. .debug_sfnames 0 : { *(.debug_sfnames) }
  119. /* DWARF 1.1 and DWARF 2 */
  120. .debug_aranges 0 : { *(.debug_aranges) }
  121. .debug_pubnames 0 : { *(.debug_pubnames) }
  122. /* DWARF 2 */
  123. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  124. .debug_abbrev 0 : { *(.debug_abbrev) }
  125. .debug_line 0 : { *(.debug_line) }
  126. .debug_frame 0 : { *(.debug_frame) }
  127. .debug_str 0 : { *(.debug_str) }
  128. .debug_loc 0 : { *(.debug_loc) }
  129. .debug_macinfo 0 : { *(.debug_macinfo) }
  130. /* SGI/MIPS DWARF 2 extensions */
  131. .debug_weaknames 0 : { *(.debug_weaknames) }
  132. .debug_funcnames 0 : { *(.debug_funcnames) }
  133. .debug_typenames 0 : { *(.debug_typenames) }
  134. .debug_varnames 0 : { *(.debug_varnames) }
  135. }