rtthread-lpc408x.ld 4.3 KB

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