Efm32gg_rom.ld 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. /***************************************************************************//**
  2. * @file efm32_rom_gg.ld
  3. * @brief Linker script for EFM32 giant gecko with GNU ld
  4. * COPYRIGHT (C) 2011, RT-Thread Development Team
  5. * @author 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
  10. * LICENSE in this distribution or at http://www.rt-thread.org/license/LICENSE
  11. *******************************************************************************
  12. * @section Change Logs
  13. * Date Author Notes
  14. * 2011-12-08 onelife Initial creation for EFM3 giant gecko
  15. * support
  16. ******************************************************************************/
  17. OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
  18. ENTRY(__cs3_reset)
  19. SEARCH_DIR(.)
  20. GROUP(-lgcc -lc -lcs3 -lcs3unhosted)
  21. MEMORY
  22. {
  23. CODE (rx) : ORIGIN = 0x00000000, LENGTH = 1024K
  24. DATA (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
  25. }
  26. _system_stack_size = 0x200;
  27. /* These force the linker to search for particular symbols from
  28. * the start of the link process and thus ensure the user's
  29. * overrides are picked up
  30. */
  31. EXTERN(__cs3_reset __cs3_reset_efm32)
  32. EXTERN(__cs3_start_asm _start)
  33. PROVIDE(__cs3_reset = __cs3_reset_efm32);
  34. PROVIDE(__cs3_start_asm = _start);
  35. SECTIONS
  36. {
  37. .text :
  38. {
  39. . = ALIGN(4);
  40. KEEP(*(.cs3.interrupt_vector)) /* Startup code */
  41. . = ALIGN(4);
  42. *(.cs3.reset)
  43. *(.cs3.init)
  44. *(.text) /* remaining code */
  45. *(.text.*) /* remaining code */
  46. *(.rodata) /* read-only data (constants) */
  47. *(.rodata*)
  48. *(.glue_7)
  49. *(.glue_7t)
  50. *(.gnu.linkonce.t*)
  51. /* section information for finsh shell */
  52. . = ALIGN(4);
  53. __fsymtab_start = .;
  54. KEEP(*(FSymTab))
  55. __fsymtab_end = .;
  56. . = ALIGN(4);
  57. __vsymtab_start = .;
  58. KEEP(*(VSymTab))
  59. __vsymtab_end = .;
  60. . = ALIGN(4);
  61. . = ALIGN(4);
  62. _etext = .;
  63. } > CODE = 0
  64. /* .ARM.exidx is sorted, so has to go in its own output section. */
  65. __exidx_start = .;
  66. .ARM.exidx :
  67. {
  68. *(.ARM.exidx* .gnu.linkonce.armexidx.*)
  69. /* This is used by the startup in order to initialize the .data secion */
  70. _sidata = .;
  71. } > CODE
  72. __exidx_end = .;
  73. /* .data section which is used for initialized data */
  74. .data : AT (_sidata)
  75. {
  76. . = ALIGN(4);
  77. /* This is used by the startup in order to initialize the .data secion */
  78. _sdata = . ;
  79. *(.data)
  80. *(.data.*)
  81. *(.gnu.linkonce.d*)
  82. . = ALIGN(4);
  83. /* This is used by the startup in order to initialize the .data secion */
  84. _edata = . ;
  85. } >DATA
  86. .stack :
  87. {
  88. . = . + _system_stack_size;
  89. . = ALIGN(4);
  90. __cs3_stack = .;
  91. } >DATA
  92. __bss_start = .;
  93. .bss :
  94. {
  95. . = ALIGN(4);
  96. /* This is used by the startup in order to initialize the .bss secion */
  97. _sbss = .;
  98. *(.bss)
  99. *(.bss.*)
  100. *(COMMON)
  101. . = ALIGN(4);
  102. /* This is used by the startup in order to initialize the .bss secion */
  103. _ebss = . ;
  104. *(.bss.init)
  105. } > DATA
  106. __bss_end = .;
  107. _end = .;
  108. /* Stabs debugging sections. */
  109. .stab 0 : { *(.stab) }
  110. .stabstr 0 : { *(.stabstr) }
  111. .stab.excl 0 : { *(.stab.excl) }
  112. .stab.exclstr 0 : { *(.stab.exclstr) }
  113. .stab.index 0 : { *(.stab.index) }
  114. .stab.indexstr 0 : { *(.stab.indexstr) }
  115. .comment 0 : { *(.comment) }
  116. /* DWARF debug sections.
  117. * Symbols in the DWARF debugging sections are relative to
  118. * the beginning of the section so we begin them at 0.
  119. */
  120. /* DWARF 1 */
  121. .debug 0 : { *(.debug) }
  122. .line 0 : { *(.line) }
  123. /* GNU DWARF 1 extensions */
  124. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  125. .debug_sfnames 0 : { *(.debug_sfnames) }
  126. /* DWARF 1.1 and DWARF 2 */
  127. .debug_aranges 0 : { *(.debug_aranges) }
  128. .debug_pubnames 0 : { *(.debug_pubnames) }
  129. /* DWARF 2 */
  130. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  131. .debug_abbrev 0 : { *(.debug_abbrev) }
  132. .debug_line 0 : { *(.debug_line) }
  133. .debug_frame 0 : { *(.debug_frame) }
  134. .debug_str 0 : { *(.debug_str) }
  135. .debug_loc 0 : { *(.debug_loc) }
  136. .debug_macinfo 0 : { *(.debug_macinfo) }
  137. /* DWARF 2.1 */
  138. .debug_ranges 0 : { *(.debug_ranges) }
  139. /* SGI/MIPS DWARF 2 extensions */
  140. .debug_weaknames 0 : { *(.debug_weaknames) }
  141. .debug_funcnames 0 : { *(.debug_funcnames) }
  142. .debug_typenames 0 : { *(.debug_typenames) }
  143. .debug_varnames 0 : { *(.debug_varnames) }
  144. .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
  145. .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) }
  146. /DISCARD/ : { *(.note.GNU-stack) }
  147. }