stm32_rom.ld 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /*
  2. * linker script for STM32F10x with GNU ld
  3. * bernard.xiong 2009-10-14
  4. */
  5. /* Program Entry, set to mark it as "used" and avoid gc */
  6. MEMORY
  7. {
  8. CODE (rx) : ORIGIN = 0x08000000, LENGTH = 0x00080000
  9. DATA (rw) : ORIGIN = 0x20000000, LENGTH = 0x00010000
  10. }
  11. ENTRY(Reset_Handler)
  12. SECTIONS
  13. {
  14. .text :
  15. {
  16. . = ALIGN(4);
  17. KEEP(*(.isr_vector)) /* Startup code */
  18. . = ALIGN(4);
  19. *(.text) /* remaining code */
  20. *(.text.*) /* remaining code */
  21. *(.rodata) /* read-only data (constants) */
  22. *(.rodata*)
  23. *(.glue_7)
  24. *(.glue_7t)
  25. . = ALIGN(4);
  26. _etext = .;
  27. /* This is used by the startup in order to initialize the .data secion */
  28. _sidata = _etext;
  29. } > CODE = 0
  30. .FSymTab :
  31. {
  32. . = ALIGN(4);
  33. __fsymtab_start = .;
  34. *(.FSymTab)
  35. __fsymtab_end = .;
  36. . = ALIGN(4);
  37. } > CODE
  38. .VSymTab :
  39. {
  40. . = ALIGN(4);
  41. __vsymtab_start = .;
  42. *(.VSymTab)
  43. __vsymtab_end = .;
  44. . = ALIGN(4);
  45. } > CODE
  46. /* .data section which is used for initialized data */
  47. .data : AT (_sidata)
  48. {
  49. . = ALIGN(4);
  50. /* This is used by the startup in order to initialize the .data secion */
  51. _sdata = . ;
  52. *(.data)
  53. *(.data.*)
  54. . = ALIGN(4);
  55. /* This is used by the startup in order to initialize the .data secion */
  56. _edata = . ;
  57. } >DATA
  58. __bss_start = .;
  59. .bss :
  60. {
  61. . = ALIGN(4);
  62. /* This is used by the startup in order to initialize the .bss secion */
  63. _sbss = .;
  64. *(.bss)
  65. *(COMMON)
  66. . = ALIGN(4);
  67. /* This is used by the startup in order to initialize the .bss secion */
  68. _ebss = . ;
  69. _estack = .;
  70. } > DATA
  71. __bss_end = .;
  72. _end = .;
  73. /* Stabs debugging sections. */
  74. .stab 0 : { *(.stab) }
  75. .stabstr 0 : { *(.stabstr) }
  76. .stab.excl 0 : { *(.stab.excl) }
  77. .stab.exclstr 0 : { *(.stab.exclstr) }
  78. .stab.index 0 : { *(.stab.index) }
  79. .stab.indexstr 0 : { *(.stab.indexstr) }
  80. .comment 0 : { *(.comment) }
  81. /* DWARF debug sections.
  82. * Symbols in the DWARF debugging sections are relative to the beginning
  83. * of the section so we begin them at 0. */
  84. /* DWARF 1 */
  85. .debug 0 : { *(.debug) }
  86. .line 0 : { *(.line) }
  87. /* GNU DWARF 1 extensions */
  88. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  89. .debug_sfnames 0 : { *(.debug_sfnames) }
  90. /* DWARF 1.1 and DWARF 2 */
  91. .debug_aranges 0 : { *(.debug_aranges) }
  92. .debug_pubnames 0 : { *(.debug_pubnames) }
  93. /* DWARF 2 */
  94. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  95. .debug_abbrev 0 : { *(.debug_abbrev) }
  96. .debug_line 0 : { *(.debug_line) }
  97. .debug_frame 0 : { *(.debug_frame) }
  98. .debug_str 0 : { *(.debug_str) }
  99. .debug_loc 0 : { *(.debug_loc) }
  100. .debug_macinfo 0 : { *(.debug_macinfo) }
  101. /* SGI/MIPS DWARF 2 extensions */
  102. .debug_weaknames 0 : { *(.debug_weaknames) }
  103. .debug_funcnames 0 : { *(.debug_funcnames) }
  104. .debug_typenames 0 : { *(.debug_typenames) }
  105. .debug_varnames 0 : { *(.debug_varnames) }
  106. }