ft32.sc 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. TORS=".tors :
  2. {
  3. ___ctors = . ;
  4. *(.ctors)
  5. ___ctors_end = . ;
  6. ___dtors = . ;
  7. *(.dtors)
  8. ___dtors_end = . ;
  9. . = ALIGN(4);
  10. } > ram"
  11. cat <<EOF
  12. OUTPUT_FORMAT("${OUTPUT_FORMAT}")
  13. OUTPUT_ARCH(${ARCH})
  14. ${LIB_SEARCH_DIRS}
  15. PROVIDE( __PMSIZE = 256K );
  16. PROVIDE( __RAMSIZE = 64K );
  17. MEMORY
  18. {
  19. flash (rx) : ORIGIN = 0, LENGTH = __PMSIZE
  20. ram (rw!x) : ORIGIN = 0x800000, LENGTH = __RAMSIZE
  21. }
  22. SECTIONS
  23. {
  24. .text :
  25. {
  26. *(.text*)
  27. *(.strings)
  28. *(._pm*)
  29. *(.init)
  30. *(.fini)
  31. ${RELOCATING+ _etext = . ; }
  32. . = ALIGN(4);
  33. } ${RELOCATING+ > flash}
  34. ${CONSTRUCTING+${TORS}}
  35. .data : AT (ADDR (.text) + SIZEOF (.text))
  36. {
  37. *(.data)
  38. *(.rodata)
  39. *(.rodata*)
  40. ${RELOCATING+ _edata = . ; }
  41. } ${RELOCATING+ > ram}
  42. .bss SIZEOF(.data) + ADDR(.data) :
  43. {
  44. ${RELOCATING+ _bss_start = . ; }
  45. *(.bss)
  46. *(COMMON)
  47. ${RELOCATING+ _end = . ; }
  48. } ${RELOCATING+ > ram}
  49. ${RELOCATING+ __data_load_start = LOADADDR(.data); }
  50. ${RELOCATING+ __data_load_end = __data_load_start + SIZEOF(.data); }
  51. .stab 0 ${RELOCATING+(NOLOAD)} :
  52. {
  53. *(.stab)
  54. }
  55. .stabstr 0 ${RELOCATING+(NOLOAD)} :
  56. {
  57. *(.stabstr)
  58. }
  59. }
  60. EOF