efm32_rom.ld 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /******************************************************************//**
  2. * @file efm32_rom.ld
  3. * @brief Linker script for EFM32 with GNU ld
  4. * COPYRIGHT (C) 2011, RT-Thread Development Team
  5. * @author Bernard, onelife
  6. * @version 0.4 beta
  7. **********************************************************************
  8. * @section License
  9. * The license and distribution terms for this file may be found in the file LICENSE in this
  10. * distribution or at http://www.rt-thread.org/license/LICENSE
  11. **********************************************************************
  12. * @section Change Logs
  13. * Date Author Notes
  14. * 2009-10-14 Bernard first version
  15. * 2010-12-22 onelife Modify for EFM32
  16. *********************************************************************/
  17. OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
  18. ENTRY(Reset_Handler)
  19. SEARCH_DIR(.)
  20. GROUP(-lgcc -lc -lcs3 -lcs3unhosted)
  21. MEMORY
  22. {
  23. CODE (rx) : ORIGIN = 0x00000000, LENGTH = 128K
  24. DATA (rwx) : ORIGIN = 0x20000000, LENGTH = 16K
  25. }
  26. SECTIONS
  27. {
  28. .text :
  29. {
  30. . = ALIGN(4);
  31. KEEP(*(.isr_vector)) /* Startup code */
  32. . = ALIGN(4);
  33. *(.text) /* remaining code */
  34. *(.text.*) /* remaining code */
  35. *(.rodata) /* read-only data (constants) */
  36. *(.rodata*)
  37. *(.glue_7)
  38. *(.glue_7t)
  39. /* section information for finsh shell */
  40. . = ALIGN(4);
  41. __fsymtab_start = .;
  42. KEEP(*(FSymTab))
  43. __fsymtab_end = .;
  44. . = ALIGN(4);
  45. __vsymtab_start = .;
  46. KEEP(*(VSymTab))
  47. __vsymtab_end = .;
  48. . = ALIGN(4);
  49. . = ALIGN(4);
  50. _etext = .;
  51. /* This is used by the startup in order to initialize the .data secion */
  52. _sidata = _etext;
  53. } > CODE = 0
  54. /* .data section which is used for initialized data */
  55. .data : AT (_sidata)
  56. {
  57. . = ALIGN(4);
  58. /* This is used by the startup in order to initialize the .data secion */
  59. _sdata = . ;
  60. *(.data)
  61. *(.data.*)
  62. . = ALIGN(4);
  63. /* This is used by the startup in order to initialize the .data secion */
  64. _edata = . ;
  65. } >DATA
  66. __bss_start = .;
  67. .bss :
  68. {
  69. . = ALIGN(4);
  70. /* This is used by the startup in order to initialize the .bss secion */
  71. _sbss = .;
  72. *(.bss)
  73. *(COMMON)
  74. . = ALIGN(4);
  75. /* This is used by the startup in order to initialize the .bss secion */
  76. _ebss = . ;
  77. _estack = .;
  78. *(.bss.init)
  79. } > DATA
  80. __bss_end = .;
  81. _end = .;
  82. /* Stabs debugging sections. */
  83. .stab 0 : { *(.stab) }
  84. .stabstr 0 : { *(.stabstr) }
  85. .stab.excl 0 : { *(.stab.excl) }
  86. .stab.exclstr 0 : { *(.stab.exclstr) }
  87. .stab.index 0 : { *(.stab.index) }
  88. .stab.indexstr 0 : { *(.stab.indexstr) }
  89. .comment 0 : { *(.comment) }
  90. /* DWARF debug sections.
  91. * Symbols in the DWARF debugging sections are relative to
  92. * the beginning of the section so we begin them at 0.
  93. */
  94. /* DWARF 1 */
  95. .debug 0 : { *(.debug) }
  96. .line 0 : { *(.line) }
  97. /* GNU DWARF 1 extensions */
  98. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  99. .debug_sfnames 0 : { *(.debug_sfnames) }
  100. /* DWARF 1.1 and DWARF 2 */
  101. .debug_aranges 0 : { *(.debug_aranges) }
  102. .debug_pubnames 0 : { *(.debug_pubnames) }
  103. /* DWARF 2 */
  104. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  105. .debug_abbrev 0 : { *(.debug_abbrev) }
  106. .debug_line 0 : { *(.debug_line) }
  107. .debug_frame 0 : { *(.debug_frame) }
  108. .debug_str 0 : { *(.debug_str) }
  109. .debug_loc 0 : { *(.debug_loc) }
  110. .debug_macinfo 0 : { *(.debug_macinfo) }
  111. /* DWARF 2.1 */
  112. .debug_ranges 0 : { *(.debug_ranges) }
  113. /* SGI/MIPS DWARF 2 extensions */
  114. .debug_weaknames 0 : { *(.debug_weaknames) }
  115. .debug_funcnames 0 : { *(.debug_funcnames) }
  116. .debug_typenames 0 : { *(.debug_typenames) }
  117. .debug_varnames 0 : { *(.debug_varnames) }
  118. .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
  119. .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) }
  120. /DISCARD/ : { *(.note.GNU-stack) }
  121. }