rtthread-lpc43xx.ld 3.8 KB

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