stm32_rom.ld 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. /* section information for finsh shell */
  26. . = ALIGN(4);
  27. __fsymtab_start = .;
  28. KEEP(*(FSymTab))
  29. __fsymtab_end = .;
  30. . = ALIGN(4);
  31. __vsymtab_start = .;
  32. KEEP(*(VSymTab))
  33. __vsymtab_end = .;
  34. . = ALIGN(4);
  35. . = ALIGN(4);
  36. _etext = .;
  37. /* This is used by the startup in order to initialize the .data secion */
  38. _sidata = _etext;
  39. } > CODE = 0
  40. /* .data section which is used for initialized data */
  41. .data : AT (_sidata)
  42. {
  43. . = ALIGN(4);
  44. /* This is used by the startup in order to initialize the .data secion */
  45. _sdata = . ;
  46. *(.data)
  47. *(.data.*)
  48. . = ALIGN(4);
  49. /* This is used by the startup in order to initialize the .data secion */
  50. _edata = . ;
  51. } >DATA
  52. __bss_start = .;
  53. .bss :
  54. {
  55. . = ALIGN(4);
  56. /* This is used by the startup in order to initialize the .bss secion */
  57. _sbss = .;
  58. *(.bss)
  59. *(COMMON)
  60. . = ALIGN(4);
  61. /* This is used by the startup in order to initialize the .bss secion */
  62. _ebss = . ;
  63. _estack = .;
  64. *(.bss.init)
  65. } > DATA
  66. __bss_end = .;
  67. _end = .;
  68. /* Stabs debugging sections. */
  69. .stab 0 : { *(.stab) }
  70. .stabstr 0 : { *(.stabstr) }
  71. .stab.excl 0 : { *(.stab.excl) }
  72. .stab.exclstr 0 : { *(.stab.exclstr) }
  73. .stab.index 0 : { *(.stab.index) }
  74. .stab.indexstr 0 : { *(.stab.indexstr) }
  75. .comment 0 : { *(.comment) }
  76. /* DWARF debug sections.
  77. * Symbols in the DWARF debugging sections are relative to the beginning
  78. * of the section so we begin them at 0. */
  79. /* DWARF 1 */
  80. .debug 0 : { *(.debug) }
  81. .line 0 : { *(.line) }
  82. /* GNU DWARF 1 extensions */
  83. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  84. .debug_sfnames 0 : { *(.debug_sfnames) }
  85. /* DWARF 1.1 and DWARF 2 */
  86. .debug_aranges 0 : { *(.debug_aranges) }
  87. .debug_pubnames 0 : { *(.debug_pubnames) }
  88. /* DWARF 2 */
  89. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  90. .debug_abbrev 0 : { *(.debug_abbrev) }
  91. .debug_line 0 : { *(.debug_line) }
  92. .debug_frame 0 : { *(.debug_frame) }
  93. .debug_str 0 : { *(.debug_str) }
  94. .debug_loc 0 : { *(.debug_loc) }
  95. .debug_macinfo 0 : { *(.debug_macinfo) }
  96. /* SGI/MIPS DWARF 2 extensions */
  97. .debug_weaknames 0 : { *(.debug_weaknames) }
  98. .debug_funcnames 0 : { *(.debug_funcnames) }
  99. .debug_typenames 0 : { *(.debug_typenames) }
  100. .debug_varnames 0 : { *(.debug_varnames) }
  101. }