link.ld 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * This Source Code Form is subject to the terms of the MIT License.
  3. * If a copy of the MIT License was not distributed with this file,
  4. * you can obtain one at https://opensource.org/licenses/MIT
  5. */
  6. /* entry point address for ELF */
  7. ENTRY(isr_reset)
  8. /* place stack at 64K SRAM */
  9. _end_stack = 0x20010000;
  10. /* Specify the memory areas */
  11. MEMORY
  12. {
  13. FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 64K
  14. RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
  15. }
  16. SECTIONS
  17. {
  18. .text :
  19. {
  20. . = ALIGN(4);
  21. *(.isr_vector)
  22. *(.text)
  23. *(.text*)
  24. . = ALIGN(4);
  25. _end_text = .;
  26. } >FLASH
  27. .rodata :
  28. {
  29. . = ALIGN(8);
  30. *(.rodata)
  31. *(.rodata*)
  32. . = ALIGN(8);
  33. } >FLASH
  34. _stored_data = LOADADDR(.data);
  35. .data :
  36. {
  37. . = ALIGN(8);
  38. _start_data = .;
  39. *(.data)
  40. *(.data*)
  41. . = ALIGN(8);
  42. _end_data = .;
  43. } >RAM AT> FLASH
  44. . = ALIGN(8);
  45. .bss :
  46. {
  47. _start_bss = .;
  48. __bss_start__ = _start_bss;
  49. *(.bss)
  50. *(.bss*)
  51. *(COMMON)
  52. . = ALIGN(8);
  53. _end_bss = .;
  54. __bss_end__ = _end_bss;
  55. _start_heap = _end_bss;
  56. } >RAM
  57. /DISCARD/ :
  58. {
  59. libc.a ( * )
  60. libm.a ( * )
  61. libgcc.a ( * )
  62. }
  63. }