lpc17xx_flash.ld 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /************************************************************************************
  2. *
  3. * lpc17xx_flash.ld - linker script include for nutos on cortex-m3 NXP LPC17xx series
  4. *
  5. ************************************************************************************/
  6. /* PROVIDE (__heap_start = _sheap); */
  7. _ramend = ORIGIN(SRAM0) + LENGTH(SRAM0);
  8. SECTIONS
  9. {
  10. .text :
  11. {
  12. . = ALIGN(4);
  13. _svect = .;
  14. KEEP(*(.isr_vector))
  15. _evect = .;
  16. *(.nutinit)
  17. /* CRP section */
  18. . = 0x000002fc;
  19. KEEP(*(.crp))
  20. . = ALIGN(4);
  21. *(.text .text.* .gnu.linkonce.t.*)
  22. *(.rodata .rodata* .gnu.linkonce.r.*)
  23. *(.glue_7t)
  24. *(.glue_7)
  25. *(.gcc_except_table)
  26. . = ALIGN(4);
  27. } > FLASH0
  28. /* .ARM.exidx is sorted, so has to go in its own output section. */
  29. .exidx : {
  30. __exidx_start = .;
  31. *(..exidx* .gnu.linkonce.armexidx.*)
  32. __exidx_end = .;
  33. } > FLASH0
  34. _etext = .;
  35. .vtable (NOLOAD):
  36. {
  37. . = ALIGN(4);
  38. _vtable = .;
  39. *(.vtable*)
  40. . = ALIGN(4);
  41. _evtable = .;
  42. } > SRAM0
  43. .data : AT (_etext)
  44. {
  45. _sdata = .;
  46. *(.data .data.* .gnu.linkonce.d.*)
  47. . = ALIGN(4);
  48. *(.ramfunc);
  49. . = ALIGN(4);
  50. _edata = .;
  51. } > SRAM0
  52. .bss (NOLOAD):
  53. {
  54. _sbss = .;
  55. *(.bss .bss.* .gnu.linkonce.b.*)
  56. *(COMMON)
  57. . = ALIGN(4);
  58. _ebss = .;
  59. } > SRAM0
  60. .stack (NOLOAD):
  61. {
  62. . = ALIGN(8);
  63. _stack_start = .;
  64. KEEP(*(.stack .stack.*));
  65. _stack_end = .;
  66. } > SRAM0
  67. .psp_stack (NOLOAD):
  68. {
  69. . = ALIGN(8);
  70. _pspstack_start = .;
  71. KEEP(*(.psp_stack .psp_stack.*));
  72. _pspstack_end = .;
  73. PROVIDE (__heap_start = .);
  74. } > SRAM0
  75. /*
  76. .heap (NOLOAD):
  77. {
  78. . = ALIGN(4);
  79. _sheap = .;
  80. . = _ramend - .;
  81. _eheap = .;
  82. } > SRAM0
  83. */
  84. end = .;
  85. /*
  86. DISCARD :
  87. {
  88. libc.a ( * )
  89. libm.a ( * )
  90. libgcc.a ( * )
  91. }
  92. */
  93. /* Stabs debugging sections. */
  94. .stab 0 : { *(.stab) }
  95. .stabstr 0 : { *(.stabstr) }
  96. .stab.excl 0 : { *(.stab.excl) }
  97. .stab.exclstr 0 : { *(.stab.exclstr) }
  98. .stab.index 0 : { *(.stab.index) }
  99. .stab.indexstr 0 : { *(.stab.indexstr) }
  100. .comment 0 : { *(.comment) }
  101. /* DWARF debug sections.
  102. Symbols in the DWARF debugging sections are relative to the beginning
  103. of the section so we begin them at 0. */
  104. /* DWARF 1 */
  105. .debug 0 : { *(.debug) }
  106. .line 0 : { *(.line) }
  107. /* GNU DWARF 1 extensions */
  108. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  109. .debug_sfnames 0 : { *(.debug_sfnames) }
  110. /* DWARF 1.1 and DWARF 2 */
  111. .debug_aranges 0 : { *(.debug_aranges) }
  112. .debug_pubnames 0 : { *(.debug_pubnames) }
  113. /* DWARF 2 */
  114. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  115. .debug_abbrev 0 : { *(.debug_abbrev) }
  116. .debug_line 0 : { *(.debug_line) }
  117. .debug_frame 0 : { *(.debug_frame) }
  118. .debug_str 0 : { *(.debug_str) }
  119. .debug_loc 0 : { *(.debug_loc) }
  120. .debug_macinfo 0 : { *(.debug_macinfo) }
  121. /* SGI/MIPS DWARF 2 extensions */
  122. .debug_weaknames 0 : { *(.debug_weaknames) }
  123. .debug_funcnames 0 : { *(.debug_funcnames) }
  124. .debug_typenames 0 : { *(.debug_typenames) }
  125. .debug_varnames 0 : { *(.debug_varnames) }
  126. }