link.ld 4.4 KB

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