ldscript.ld 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /* Default linker script, for normal executables */
  2. OUTPUT_FORMAT("elf32-ft32")
  3. OUTPUT_ARCH(ft32)
  4. SEARCH_DIR("/data/win8/ft32/ft32-elf/lib");
  5. /* Allow the command line to override the memory region sizes. */
  6. __PMSIZE = DEFINED(__PMSIZE) ? __PMSIZE : 256K;
  7. __RAMSIZE = DEFINED(__RAMSIZE) ? __RAMSIZE : 64K;
  8. MEMORY
  9. {
  10. flash (rx) : ORIGIN = 0, LENGTH = __PMSIZE
  11. ram (rw!x) : ORIGIN = 0x800000, LENGTH = __RAMSIZE
  12. ehci_mmap (rw!x) : ORIGIN = 0x811000, LENGTH = 2K
  13. }
  14. SECTIONS
  15. {
  16. .text :
  17. {
  18. *(.text*)
  19. *(.strings)
  20. *(._pm*)
  21. *(.init)
  22. *(.fini)
  23. _etext = . ;
  24. . = ALIGN(4);
  25. } > flash
  26. .tors :
  27. {
  28. ___ctors = . ;
  29. *(.ctors)
  30. ___ctors_end = . ;
  31. ___dtors = . ;
  32. *(.dtors)
  33. ___dtors_end = . ;
  34. . = ALIGN(4);
  35. } > ram
  36. .data : AT (ADDR (.text) + SIZEOF (.text))
  37. {
  38. *(.data)
  39. *(.data*)
  40. *(.rodata)
  41. *(.rodata*)
  42. _edata = . ;
  43. . = ALIGN(4);
  44. } > ram
  45. .bss SIZEOF(.data) + ADDR(.data) :
  46. {
  47. _bss_start = . ;
  48. *(.bss)
  49. *(.bss*)
  50. *(COMMON)
  51. _end = . ;
  52. . = ALIGN(4);
  53. } > ram
  54. __data_load_start = LOADADDR(.data);
  55. __data_load_end = __data_load_start + SIZEOF(.data);
  56. .stab 0 (NOLOAD) :
  57. {
  58. *(.stab)
  59. }
  60. .stabstr 0 (NOLOAD) :
  61. {
  62. *(.stabstr)
  63. }
  64. /* DWARF debug sections.
  65. Symbols in the DWARF debugging sections are relative to the beginning
  66. of the section so we begin them at 0. */
  67. /* DWARF 1 */
  68. .debug 0 : { *(.debug) }
  69. .line 0 : { *(.line) }
  70. /* GNU DWARF 1 extensions */
  71. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  72. .debug_sfnames 0 : { *(.debug_sfnames) }
  73. /* DWARF 1.1 and DWARF 2 */
  74. .debug_aranges 0 : { *(.debug_aranges) }
  75. .debug_pubnames 0 : { *(.debug_pubnames) }
  76. /* DWARF 2 */
  77. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  78. .debug_abbrev 0 : { *(.debug_abbrev) }
  79. .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) }
  80. .debug_frame 0 : { *(.debug_frame) }
  81. .debug_str 0 : { *(.debug_str) }
  82. .debug_loc 0 : { *(.debug_loc) }
  83. .debug_macinfo 0 : { *(.debug_macinfo) }
  84. /* SGI/MIPS DWARF 2 extensions */
  85. .debug_weaknames 0 : { *(.debug_weaknames) }
  86. .debug_funcnames 0 : { *(.debug_funcnames) }
  87. .debug_typenames 0 : { *(.debug_typenames) }
  88. .debug_varnames 0 : { *(.debug_varnames) }
  89. /* DWARF 3 */
  90. .debug_pubtypes 0 : { *(.debug_pubtypes) }
  91. .debug_ranges 0 : { *(.debug_ranges) }
  92. /* DWARF Extension. */
  93. .debug_macro 0 : { *(.debug_macro) }
  94. .debug_addr 0 : { *(.debug_addr) }
  95. }