rtthread-lpc43xx.ld 3.9 KB

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