app.ld 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. /* Entry Point */
  2. ENTRY(Reset_Handler)
  3. /* Highest address of the user mode stack */
  4. _stext = ORIGIN(FLASH);
  5. _Min_Heap_Size = 0 ; /* required amount of heap */
  6. _Min_Stack_Size = 0x4000 ; /* required amount of stack */
  7. _estack = ORIGIN(RAM) + _Min_Stack_Size + _Min_Heap_Size; /* start of "RAM" Ram type memory */
  8. _sstack = ORIGIN(RAM); /* start of "RAM" Ram type memory */
  9. __ram_end = ORIGIN(RAM) + LENGTH(RAM);
  10. /* Memories definition */
  11. MEMORY
  12. {
  13. RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 640K
  14. FLASH (rx) : ORIGIN = 0x1010000, LENGTH = 2944K
  15. }
  16. /* Sections */
  17. SECTIONS
  18. {
  19. /* The startup code into "FLASH" Rom type memory */
  20. .app_info :
  21. {
  22. . = ALIGN(512);
  23. KEEP(*(.app_info)) /* Startup code */
  24. . = ALIGN(512);
  25. } >FLASH
  26. .isr_vector :
  27. {
  28. . = ALIGN(4);
  29. __isr_start_address = .;
  30. KEEP(*(.isr_vector)) /* Startup code */
  31. . = ALIGN(4);
  32. } >FLASH
  33. /* The program code and other data into "FLASH" Rom type memory */
  34. .start :
  35. {
  36. . = ALIGN(4);
  37. *startup_full.o(.text .text.*)
  38. } >FLASH
  39. .text :
  40. {
  41. . = ALIGN(4);
  42. *start_full.o(.text .text.*)
  43. *(.text) /* .text sections (code) */
  44. *(.text*) /* .text* sections (code) */
  45. *(.glue_7) /* glue arm to thumb code */
  46. *(.glue_7t) /* glue thumb to arm code */
  47. *(.eh_frame)
  48. KEEP (*(.init))
  49. KEEP (*(.fini))
  50. . = ALIGN(4);
  51. _etext = .; /* define a global symbols at end of code */
  52. } >FLASH
  53. /* Constant data into "FLASH" Rom type memory */
  54. .rodata :
  55. {
  56. . = ALIGN(4);
  57. *(.rodata) /* .rodata sections (constants, strings, etc.) */
  58. *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
  59. . = ALIGN(4);
  60. } >FLASH
  61. .ARM.extab : {
  62. . = ALIGN(4);
  63. *(.ARM.extab* .gnu.linkonce.armextab.*)
  64. . = ALIGN(4);
  65. } >FLASH
  66. .ARM : {
  67. . = ALIGN(4);
  68. __exidx_start = .;
  69. *(.ARM.exidx*)
  70. __exidx_end = .;
  71. . = ALIGN(4);
  72. } >FLASH
  73. .preinit_array :
  74. {
  75. . = ALIGN(4);
  76. PROVIDE_HIDDEN (__preinit_array_start = .);
  77. KEEP (*(.preinit_array*))
  78. PROVIDE_HIDDEN (__preinit_array_end = .);
  79. . = ALIGN(4);
  80. } >FLASH
  81. .init_array :
  82. {
  83. . = ALIGN(4);
  84. PROVIDE_HIDDEN (__init_array_start = .);
  85. KEEP (*(SORT(.init_array.*)))
  86. KEEP (*(.init_array*))
  87. PROVIDE_HIDDEN (__init_array_end = .);
  88. . = ALIGN(4);
  89. } >FLASH
  90. .fini_array :
  91. {
  92. . = ALIGN(4);
  93. PROVIDE_HIDDEN (__fini_array_start = .);
  94. KEEP (*(SORT(.fini_array.*)))
  95. KEEP (*(.fini_array*))
  96. PROVIDE_HIDDEN (__fini_array_end = .);
  97. . = ALIGN(4);
  98. } >FLASH
  99. .preinit_fun_array :
  100. {
  101. . = ALIGN(4);
  102. __preinit_fun_array_start = .;
  103. KEEP (*(SORT(.preinit_fun_array.*)))
  104. KEEP (*(.preinit_fun_array*))
  105. __preinit_fun_array_end = .;
  106. . = ALIGN(4);
  107. } > FLASH
  108. .init_fun_array :
  109. {
  110. . = ALIGN(4);
  111. __init_fun_array_start = .;
  112. KEEP (*(SORT(.init_fun_array.*)))
  113. KEEP (*(.init_fun_array*))
  114. __init_fun_array_end = .;
  115. . = ALIGN(4);
  116. } > FLASH
  117. .task_fun_array :
  118. {
  119. . = ALIGN(4);
  120. __task_fun_array_start = .;
  121. KEEP (*(SORT(.task_fun_array.*)))
  122. KEEP (*(.task_fun_array*))
  123. __task_fun_array_end = .;
  124. . = ALIGN(4);
  125. } > FLASH
  126. /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */
  127. ._user_heap_stack :
  128. {
  129. . = ALIGN(8);
  130. PROVIDE ( end = . );
  131. PROVIDE ( _end = . );
  132. . = . + _Min_Heap_Size;
  133. . = . + _Min_Stack_Size;
  134. . = ALIGN(8);
  135. } >RAM
  136. /* Initialized data sections into "RAM" Ram type memory */
  137. /* Used by the startup to initialize data */
  138. _sidata = LOADADDR(.data);
  139. .data :
  140. {
  141. . = ALIGN(4);
  142. _sdata = .; /* create a global symbol at data start */
  143. *(.data) /* .data sections */
  144. *(.data*) /* .data* sections */
  145. *(.RamFunc) /* .RamFunc sections */
  146. *(.RamFunc*) /* .RamFunc* sections */
  147. . = ALIGN(4);
  148. _edata = .; /* define a global symbol at data end */
  149. } >RAM AT> FLASH
  150. /* Uninitialized data section into "RAM" Ram type memory */
  151. . = ALIGN(4);
  152. .bss :
  153. {
  154. /* This is used by the startup in order to initialize the .bss section */
  155. _sbss = .; /* define a global symbol at bss start */
  156. __bss_start__ = _sbss;
  157. *(.bss)
  158. *(.bss*)
  159. *(COMMON)
  160. . = ALIGN(4);
  161. _ebss = .; /* define a global symbol at bss end */
  162. __bss_end__ = _ebss;
  163. } >RAM
  164. . = ALIGN(16);
  165. __os_heap_start = .;
  166. /* Remove information from the compiler libraries */
  167. /DISCARD/ :
  168. {
  169. libc.a ( * )
  170. libm.a ( * )
  171. libgcc.a ( * )
  172. }
  173. .ARM.attributes 0 : { *(.ARM.attributes) }
  174. }