lm3s_rom.ld 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /*
  2. * linker script for LM3S with GNU ld
  3. * yi.qiu 2009-12-26 modified from Bernard's stm32 version
  4. */
  5. /* Program Entry, set to mark it as "used" and avoid gc */
  6. MEMORY
  7. {
  8. CODE (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000
  9. DATA (rw) : ORIGIN = 0x20000000, LENGTH = 0x00010000
  10. }
  11. ENTRY(Reset_Handler)
  12. _system_stack_size = 0x200;
  13. SECTIONS
  14. {
  15. .text :
  16. {
  17. . = ALIGN(4);
  18. KEEP(*(.isr_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. *(.ARM.extab* .gnu.linkonce.armextab.*)
  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. _etext = .;
  43. } > CODE = 0
  44. /* .ARM.exidx is sorted, so has to go in its own output section. */
  45. __exidx_start = .;
  46. .ARM.exidx :
  47. {
  48. *(.ARM.exidx* .gnu.linkonce.armexidx.*)
  49. /* This is used by the startup in order to initialize the .data secion */
  50. _sidata = .;
  51. } > CODE
  52. __exidx_end = .;
  53. /* .data section which is used for initialized data */
  54. .data : AT (_sidata)
  55. {
  56. . = ALIGN(4);
  57. /* This is used by the startup in order to initialize the .data secion */
  58. _sdata = . ;
  59. *(.data)
  60. *(.data.*)
  61. . = ALIGN(4);
  62. /* This is used by the startup in order to initialize the .data secion */
  63. _edata = . ;
  64. } >DATA
  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. *(COMMON)
  79. . = ALIGN(4);
  80. /* This is used by the startup in order to initialize the .bss secion */
  81. _ebss = . ;
  82. } > DATA
  83. __bss_end = .;
  84. _end = .;
  85. /* Stabs debugging sections. */
  86. .stab 0 : { *(.stab) }
  87. .stabstr 0 : { *(.stabstr) }
  88. .stab.excl 0 : { *(.stab.excl) }
  89. .stab.exclstr 0 : { *(.stab.exclstr) }
  90. .stab.index 0 : { *(.stab.index) }
  91. .stab.indexstr 0 : { *(.stab.indexstr) }
  92. .comment 0 : { *(.comment) }
  93. /* DWARF debug sections.
  94. * Symbols in the DWARF debugging sections are relative to the beginning
  95. * of the section so we begin them at 0. */
  96. /* DWARF 1 */
  97. .debug 0 : { *(.debug) }
  98. .line 0 : { *(.line) }
  99. /* GNU DWARF 1 extensions */
  100. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  101. .debug_sfnames 0 : { *(.debug_sfnames) }
  102. /* DWARF 1.1 and DWARF 2 */
  103. .debug_aranges 0 : { *(.debug_aranges) }
  104. .debug_pubnames 0 : { *(.debug_pubnames) }
  105. /* DWARF 2 */
  106. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  107. .debug_abbrev 0 : { *(.debug_abbrev) }
  108. .debug_line 0 : { *(.debug_line) }
  109. .debug_frame 0 : { *(.debug_frame) }
  110. .debug_str 0 : { *(.debug_str) }
  111. .debug_loc 0 : { *(.debug_loc) }
  112. .debug_macinfo 0 : { *(.debug_macinfo) }
  113. /* SGI/MIPS DWARF 2 extensions */
  114. .debug_weaknames 0 : { *(.debug_weaknames) }
  115. .debug_funcnames 0 : { *(.debug_funcnames) }
  116. .debug_typenames 0 : { *(.debug_typenames) }
  117. .debug_varnames 0 : { *(.debug_varnames) }
  118. }