avr32elf_uc3b0256.lds 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. /* Default linker script, for normal executables */
  2. OUTPUT_FORMAT("elf32-avr32", "elf32-avr32",
  3. "elf32-avr32")
  4. OUTPUT_ARCH(avr32:uc)
  5. ENTRY(_start)
  6. SEARCH_DIR("/home/mingwbuild/mingwavr32/avr32/lib");
  7. /* Do we need any of these for elf?
  8. __DYNAMIC = 0; */
  9. MEMORY
  10. {
  11. FLASH (rxai!w) : ORIGIN = 0x80000000, LENGTH = 256K
  12. CPUSRAM (wxa!ri) : ORIGIN = 0x00000004, LENGTH = 0x7FFC
  13. USERPAGE : ORIGIN = 0x80800000, LENGTH = 512
  14. FACTORYPAGE : ORIGIN = 0x80800200, LENGTH = 512
  15. }
  16. SECTIONS
  17. {
  18. /* Read-only sections, merged into text segment: */
  19. PROVIDE (__executable_start = 0x80000000); . = 0x80000000;
  20. .interp : { *(.interp) } >FLASH AT>FLASH
  21. .reset : { *(.reset) } >FLASH AT>FLASH
  22. .hash : { *(.hash) } >FLASH AT>FLASH
  23. .dynsym : { *(.dynsym) } >FLASH AT>FLASH
  24. .dynstr : { *(.dynstr) } >FLASH AT>FLASH
  25. .gnu.version : { *(.gnu.version) } >FLASH AT>FLASH
  26. .gnu.version_d : { *(.gnu.version_d) } >FLASH AT>FLASH
  27. .gnu.version_r : { *(.gnu.version_r) } >FLASH AT>FLASH
  28. .rel.init : { *(.rel.init) } >FLASH AT>FLASH
  29. .rela.init : { *(.rela.init) } >FLASH AT>FLASH
  30. .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } >FLASH AT>FLASH
  31. .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } >FLASH AT>FLASH
  32. .rel.fini : { *(.rel.fini) } >FLASH AT>FLASH
  33. .rela.fini : { *(.rela.fini) } >FLASH AT>FLASH
  34. .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } >FLASH AT>FLASH
  35. .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } >FLASH AT>FLASH
  36. .rel.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH
  37. .rela.data.rel.ro : { *(.rel.data.rel.ro*) } >FLASH AT>FLASH
  38. .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } >FLASH AT>FLASH
  39. .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } >FLASH AT>FLASH
  40. .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } >FLASH AT>FLASH
  41. .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } >FLASH AT>FLASH
  42. .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } >FLASH AT>FLASH
  43. .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } >FLASH AT>FLASH
  44. .rel.ctors : { *(.rel.ctors) } >FLASH AT>FLASH
  45. .rela.ctors : { *(.rela.ctors) } >FLASH AT>FLASH
  46. .rel.dtors : { *(.rel.dtors) } >FLASH AT>FLASH
  47. .rela.dtors : { *(.rela.dtors) } >FLASH AT>FLASH
  48. .rel.got : { *(.rel.got) } >FLASH AT>FLASH
  49. .rela.got : { *(.rela.got) } >FLASH AT>FLASH
  50. .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } >FLASH AT>FLASH
  51. .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } >FLASH AT>FLASH
  52. .rel.plt : { *(.rel.plt) } >FLASH AT>FLASH
  53. .rela.plt : { *(.rela.plt) } >FLASH AT>FLASH
  54. .init :
  55. {
  56. KEEP (*(.init))
  57. } >FLASH AT>FLASH =0xd703d703
  58. .plt : { *(.plt) } >FLASH AT>FLASH
  59. .text :
  60. {
  61. *(.text .stub .text.* .gnu.linkonce.t.*)
  62. KEEP (*(.text.*personality*))
  63. /* .gnu.warning sections are handled specially by elf32.em. */
  64. *(.gnu.warning)
  65. /* section information for finsh shell */
  66. . = ALIGN(4);
  67. __fsymtab_start = .;
  68. KEEP(*(FSymTab))
  69. __fsymtab_end = .;
  70. . = ALIGN(4);
  71. __vsymtab_start = .;
  72. KEEP(*(VSymTab))
  73. __vsymtab_end = .;
  74. . = ALIGN(4);
  75. } >FLASH AT>FLASH =0xd703d703
  76. .fini :
  77. {
  78. KEEP (*(.fini))
  79. } >FLASH AT>FLASH =0xd703d703
  80. PROVIDE (__etext = .);
  81. PROVIDE (_etext = .);
  82. PROVIDE (etext = .);
  83. .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } >FLASH AT>FLASH
  84. .rodata1 : { *(.rodata1) } >FLASH AT>FLASH
  85. .eh_frame_hdr : { *(.eh_frame_hdr) } >FLASH AT>FLASH
  86. .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } >FLASH AT>FLASH
  87. .gcc_except_table : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >FLASH AT>FLASH
  88. .dalign : { . = ALIGN(8); PROVIDE(_data_lma = .); } >FLASH AT>FLASH
  89. PROVIDE (_data = ORIGIN(CPUSRAM));
  90. . = ORIGIN(CPUSRAM);
  91. /* Exception handling */
  92. .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } >CPUSRAM AT>FLASH
  93. .gcc_except_table : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >CPUSRAM AT>FLASH
  94. /* Thread Local Storage sections */
  95. .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } >CPUSRAM AT>FLASH
  96. .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } >CPUSRAM
  97. /* Ensure the __preinit_array_start label is properly aligned. We
  98. could instead move the label definition inside the section, but
  99. the linker would then create the section even if it turns out to
  100. be empty, which isn't pretty. */
  101. PROVIDE (__preinit_array_start = ALIGN(32 / 8));
  102. .preinit_array : { KEEP (*(.preinit_array)) } >CPUSRAM AT>FLASH
  103. PROVIDE (__preinit_array_end = .);
  104. PROVIDE (__init_array_start = .);
  105. .init_array : { KEEP (*(.init_array)) } >CPUSRAM AT>FLASH
  106. PROVIDE (__init_array_end = .);
  107. PROVIDE (__fini_array_start = .);
  108. .fini_array : { KEEP (*(.fini_array)) } >CPUSRAM AT>FLASH
  109. PROVIDE (__fini_array_end = .);
  110. .ctors :
  111. {
  112. /* gcc uses crtbegin.o to find the start of
  113. the constructors, so we make sure it is
  114. first. Because this is a wildcard, it
  115. doesn't matter if the user does not
  116. actually link against crtbegin.o; the
  117. linker won't look for a file to match a
  118. wildcard. The wildcard also means that it
  119. doesn't matter which directory crtbegin.o
  120. is in. */
  121. KEEP (*crtbegin*.o(.ctors))
  122. /* We don't want to include the .ctor section from
  123. from the crtend.o file until after the sorted ctors.
  124. The .ctor section from the crtend file contains the
  125. end of ctors marker and it must be last */
  126. KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
  127. KEEP (*(SORT(.ctors.*)))
  128. KEEP (*(.ctors))
  129. } >CPUSRAM AT>FLASH
  130. .dtors :
  131. {
  132. KEEP (*crtbegin*.o(.dtors))
  133. KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
  134. KEEP (*(SORT(.dtors.*)))
  135. KEEP (*(.dtors))
  136. } >CPUSRAM AT>FLASH
  137. .jcr : { KEEP (*(.jcr)) } >CPUSRAM AT>FLASH
  138. .data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) } >CPUSRAM AT>FLASH
  139. .dynamic : { *(.dynamic) } >CPUSRAM AT>FLASH
  140. .got : { *(.got.plt) *(.got) } >CPUSRAM AT>FLASH
  141. .data :
  142. {
  143. *(.data .data.* .gnu.linkonce.d.*)
  144. KEEP (*(.gnu.linkonce.d.*personality*))
  145. SORT(CONSTRUCTORS)
  146. } >CPUSRAM AT>FLASH
  147. .data1 : { *(.data1) } >CPUSRAM AT>FLASH
  148. .balign : { . = ALIGN(8); _edata = .; } >CPUSRAM AT>FLASH
  149. _edata = .;
  150. PROVIDE (edata = .);
  151. __bss_start = .;
  152. .bss :
  153. {
  154. *(.dynbss)
  155. *(.bss .bss.* .gnu.linkonce.b.*)
  156. *(COMMON)
  157. /* Align here to ensure that the .bss section occupies space up to
  158. _end. Align after .bss to ensure correct alignment even if the
  159. .bss section disappears because there are no input sections. */
  160. . = ALIGN(8);
  161. } >CPUSRAM
  162. . = ALIGN(8);
  163. _end = .;
  164. PROVIDE (end = .);
  165. __heap_start__ = ALIGN(8);
  166. . = ORIGIN(CPUSRAM) + LENGTH(CPUSRAM) - _stack_size;
  167. __heap_end__ = .;
  168. /* Stabs debugging sections. */
  169. .stab 0 : { *(.stab) }
  170. .stabstr 0 : { *(.stabstr) }
  171. .stab.excl 0 : { *(.stab.excl) }
  172. .stab.exclstr 0 : { *(.stab.exclstr) }
  173. .stab.index 0 : { *(.stab.index) }
  174. .stab.indexstr 0 : { *(.stab.indexstr) }
  175. .comment 0 : { *(.comment) }
  176. /* DWARF debug sections.
  177. Symbols in the DWARF debugging sections are relative to the beginning
  178. of the section so we begin them at 0. */
  179. /* DWARF 1 */
  180. .debug 0 : { *(.debug) }
  181. .line 0 : { *(.line) }
  182. /* GNU DWARF 1 extensions */
  183. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  184. .debug_sfnames 0 : { *(.debug_sfnames) }
  185. /* DWARF 1.1 and DWARF 2 */
  186. .debug_aranges 0 : { *(.debug_aranges) }
  187. .debug_pubnames 0 : { *(.debug_pubnames) }
  188. /* DWARF 2 */
  189. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  190. .debug_abbrev 0 : { *(.debug_abbrev) }
  191. .debug_line 0 : { *(.debug_line) }
  192. .debug_frame 0 : { *(.debug_frame) }
  193. .debug_str 0 : { *(.debug_str) }
  194. .debug_loc 0 : { *(.debug_loc) }
  195. .debug_macinfo 0 : { *(.debug_macinfo) }
  196. /* SGI/MIPS DWARF 2 extensions */
  197. .debug_weaknames 0 : { *(.debug_weaknames) }
  198. .debug_funcnames 0 : { *(.debug_funcnames) }
  199. .debug_typenames 0 : { *(.debug_typenames) }
  200. .debug_varnames 0 : { *(.debug_varnames) }
  201. .stack ORIGIN(CPUSRAM) + LENGTH(CPUSRAM) - _stack_size :
  202. {
  203. _stack = .;
  204. *(.stack)
  205. . = _stack_size;
  206. _estack = .;
  207. } >CPUSRAM
  208. .userpage : { *(.userpage .userpage.*) } >USERPAGE AT>USERPAGE
  209. .factorypage : { *(.factorypage .factorypage.*) } >FACTORYPAGE AT>FACTORYPAGE
  210. /DISCARD/ : { *(.note.GNU-stack) }
  211. }