m460_link.ld 4.4 KB

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