stm32l100xc.ld 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. ENTRY(Reset_Handler)
  2. MEMORY
  3. {
  4. ROM (rx): ORIGIN = 0x08000000, LENGTH = 192K
  5. RAM (rwx): ORIGIN = 0x20000000, LENGTH = 20K
  6. }
  7. SECTIONS
  8. {
  9. .text :
  10. {
  11. KEEP(*(.isr_vector))
  12. *(.text*)
  13. KEEP(*(.init)) KEEP(*(.fini))
  14. *crtbegin.o(.ctors)
  15. *crtbegin?.o(.ctors)
  16. *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
  17. *(SORT(.ctors.*))
  18. *(.ctors)
  19. *crtbegin.o(.dtors)
  20. *crtbegin?.o(.dtors)
  21. *(EXCLUDE_FILE(*crtend?.o *crtend.o).dtors)
  22. *(SORT(.dtors.*))
  23. *(.dtors)
  24. *(.rodata*)
  25. KEEP(*(.eh_frame*))
  26. } > ROM
  27. .ARM.extab :
  28. {
  29. *(.ARM.extab* .gnu.linkonce.armextab.*)
  30. } > ROM
  31. __exidx_start = .;
  32. .ARM.exidx :
  33. {
  34. *(.ARM.exidx* .gnu.linkonce.armexidx.*)
  35. } > ROM
  36. __exidx_end = .;
  37. __etext = .;
  38. .data : AT (__etext)
  39. {
  40. __data_start__ = .;
  41. *(vtable)
  42. *(.data*)
  43. . = ALIGN(4);
  44. PROVIDE_HIDDEN (__preinit_array_start = .);
  45. KEEP(*(.preinit_array))
  46. PROVIDE_HIDDEN (__preinit_array_end = .);
  47. . = ALIGN(4);
  48. PROVIDE_HIDDEN (__init_array_start = .);
  49. KEEP(*(SORT(.init_array.*)))
  50. KEEP(*(.init_array))
  51. PROVIDE_HIDDEN (__init_array_end = .);
  52. . = ALIGN(4);
  53. PROVIDE_HIDDEN (__fini_array_start = .);
  54. KEEP(*(SORT(.fini_array.*)))
  55. KEEP(*(.fini_array))
  56. PROVIDE_HIDDEN (__fini_array_end = .);
  57. . = ALIGN(4);
  58. __data_end__ = .;
  59. } > RAM
  60. .bss (NOLOAD) :
  61. {
  62. __bss_start__ = .;
  63. *(.bss*)
  64. *(COMMON)
  65. __bss_end__ = .;
  66. } > RAM
  67. .heap (NOLOAD) :
  68. {
  69. __end__ = .;
  70. *(.heap*)
  71. __HeapLimit = .;
  72. } > RAM
  73. .stack_dummy (NOLOAD) :
  74. {
  75. *(.stack)
  76. } > RAM
  77. __StackTop = ORIGIN(RAM) + LENGTH(RAM);
  78. __StackLimit = __StackTop - SIZEOF(.stack_dummy);
  79. PROVIDE(__stack = __StackTop);
  80. ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
  81. PROVIDE(_estack = __stack);
  82. PROVIDE(_sidata = __etext);
  83. PROVIDE(_sdata = __data_start__);
  84. PROVIDE(_edata = __data_end__);
  85. PROVIDE(_sbss = __bss_start__);
  86. PROVIDE(_ebss = __bss_end__);
  87. }