Advertisement
Guest User

Untitled

a guest
Jan 24th, 2018
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.80 KB | None | 0 0
  1. /**
  2. * \file
  3. *
  4. * \brief AVR UC3 AT32UC3C ISP GNU LD script file
  5. *
  6. * Copyright (c) 2011 - 2012 Atmel Corporation. All rights reserved.
  7. *
  8. * \asf_license_start
  9. *
  10. * \page License
  11. *
  12. * Redistribution and use in source and binary forms, with or without
  13. * modification, are permitted provided that the following conditions are met:
  14. *
  15. * 1. Redistributions of source code must retain the above copyright notice,
  16. * this list of conditions and the following disclaimer.
  17. *
  18. * 2. Redistributions in binary form must reproduce the above copyright notice,
  19. * this list of conditions and the following disclaimer in the documentation
  20. * and/or other materials provided with the distribution.
  21. *
  22. * 3. The name of Atmel may not be used to endorse or promote products derived
  23. * from this software without specific prior written permission.
  24. *
  25. * 4. This software may only be redistributed and used in connection with an
  26. * Atmel microcontroller product.
  27. *
  28. * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
  29. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  30. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
  31. * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
  32. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  33. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  34. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  35. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  36. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  37. * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  38. * POSSIBILITY OF SUCH DAMAGE.
  39. *
  40. * \asf_license_stop
  41. *
  42. */
  43.  
  44. OUTPUT_FORMAT("elf32-avr32", "elf32-avr32", "elf32-avr32")
  45.  
  46. OUTPUT_ARCH(avr32:uc)
  47.  
  48. ENTRY(_start)
  49.  
  50. MEMORY
  51. {
  52. FLASH (rxai!w) : ORIGIN = 0x80000000, LENGTH = 0x00001FE0
  53. FLASH2 (rxai!w) : ORIGIN = 0x80001FE0, LENGTH = 0x00000020
  54. INTRAM (wxa!ri) : ORIGIN = 0x00000004, LENGTH = 0x000017FC
  55. }
  56.  
  57. PHDRS
  58. {
  59. FLASH PT_LOAD;
  60. FLASH2 PT_LOAD;
  61. INTRAM_ALIGN PT_NULL;
  62. INTRAM_AT_FLASH PT_LOAD;
  63. INTRAM PT_NULL;
  64. CONST_INTRAM_AT_FLASH PT_LOAD;
  65. }
  66.  
  67. SECTIONS
  68. {
  69. .HWparams : {KEEP(*(.HWparams))} >FLASH2 AT>FLASH2 :FLASH2
  70. /* Use a default heap size if heap size was not defined. */
  71. __heap_size__ = DEFINED(__heap_size__) ? __heap_size__ : 0;
  72.  
  73. /* Use a default stack size if stack size was not defined. */
  74. __stack_size__ = DEFINED(__stack_size__) ? __stack_size__ : 1K;
  75.  
  76. /* Read-only sections, merged into text segment: */
  77. PROVIDE (__executable_start = 0x80000000); . = 0x80000000;
  78. .interp : { *(.interp) } >FLASH AT>FLASH :FLASH
  79. .reset : { *(.reset) } >FLASH AT>FLASH :FLASH
  80. .text :
  81. {
  82. *(.text)
  83. } >FLASH AT>FLASH :FLASH
  84. .lalign : { . = ALIGN(8); PROVIDE(_data_lma = .); } >FLASH AT>FLASH :FLASH
  85. . = ORIGIN(INTRAM);
  86. .dalign : { . = ALIGN(8); PROVIDE(_data = .); } >INTRAM AT>INTRAM :INTRAM_ALIGN
  87. /* Exception handling */
  88. .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
  89. .gcc_except_table : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
  90. /* Thread Local Storage sections */
  91. .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
  92. .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
  93. /* Ensure the __preinit_array_start label is properly aligned. We
  94. could instead move the label definition inside the section, but
  95. the linker would then create the section even if it turns out to
  96. be empty, which isn't pretty. */
  97. PROVIDE (__preinit_array_start = ALIGN(32 / 8));
  98. .preinit_array : { KEEP (*(.preinit_array)) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
  99. PROVIDE (__preinit_array_end = .);
  100. PROVIDE (__init_array_start = .);
  101. .init_array : { KEEP (*(.init_array)) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
  102. PROVIDE (__init_array_end = .);
  103. PROVIDE (__fini_array_start = .);
  104. .fini_array : { KEEP (*(.fini_array)) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
  105. PROVIDE (__fini_array_end = .);
  106. .ctors :
  107. {
  108. /* gcc uses crtbegin.o to find the start of
  109. the constructors, so we make sure it is
  110. first. Because this is a wildcard, it
  111. doesn't matter if the user does not
  112. actually link against crtbegin.o; the
  113. linker won't look for a file to match a
  114. wildcard. The wildcard also means that it
  115. doesn't matter which directory crtbegin.o
  116. is in. */
  117. KEEP (*crtbegin*.o(.ctors))
  118. /* We don't want to include the .ctor section from
  119. from the crtend.o file until after the sorted ctors.
  120. The .ctor section from the crtend file contains the
  121. end of ctors marker and it must be last */
  122. KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
  123. KEEP (*(SORT(.ctors.*)))
  124. KEEP (*(.ctors))
  125. } >INTRAM AT>FLASH :INTRAM_AT_FLASH
  126. .dtors :
  127. {
  128. KEEP (*crtbegin*.o(.dtors))
  129. KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
  130. KEEP (*(SORT(.dtors.*)))
  131. KEEP (*(.dtors))
  132. } >INTRAM AT>FLASH :INTRAM_AT_FLASH
  133. .jcr : { KEEP (*(.jcr)) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
  134. .data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
  135. .dynamic : { *(.dynamic) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
  136. .got : { *(.got.plt) *(.got) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
  137. .ramtext : { *(.ramtext .ramtext.*) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
  138. .ddalign : { . = ALIGN(8); } >INTRAM AT>FLASH :INTRAM_AT_FLASH
  139. .data :
  140. {
  141. *(.data .data.* .gnu.linkonce.d.*)
  142. KEEP (*(.gnu.linkonce.d.*personality*))
  143. SORT(CONSTRUCTORS)
  144. } >INTRAM AT>FLASH :INTRAM_AT_FLASH
  145. .data1 : { *(.data1) } >INTRAM AT>FLASH :INTRAM_AT_FLASH
  146. .balign : { . = ALIGN(8); PROVIDE(_edata = .); } >INTRAM AT>FLASH :INTRAM_AT_FLASH
  147. PROVIDE (edata = .);
  148. __bss_start = .;
  149. .bss :
  150. {
  151. *(.dynbss)
  152. *(.bss .bss.* .gnu.linkonce.b.*)
  153. *(COMMON)
  154. /* Align here to ensure that the .bss section occupies space up to
  155. _end. Align after .bss to ensure correct alignment even if the
  156. .bss section disappears because there are no input sections. */
  157. . = ALIGN(8);
  158. } >INTRAM AT>INTRAM :INTRAM
  159. . = ALIGN(8);
  160. _end = .;
  161. PROVIDE (end = .);
  162. __heap_start__ = ALIGN(8);
  163. .heap :
  164. {
  165. *(.heap)
  166. . = __heap_size__;
  167. } >INTRAM AT>INTRAM :INTRAM
  168. __heap_end__ = .;
  169. .stack :
  170. {
  171. _stack = .;
  172. *(.stack)
  173. . = __stack_size__;
  174. _estack = .;
  175. } >INTRAM AT>INTRAM :INTRAM
  176. _const_lma = LOADADDR(.const);
  177. .const ALIGN(0x400) : AT ( (LOADADDR(.balign) + SIZEOF (.balign) + 7) & ~ 7 )
  178. {
  179. _const = .;
  180. *(.evba)
  181. *(.hash)
  182. *(.dynsym)
  183. *(.dynstr)
  184. *(.gnu.version)
  185. *(.gnu.version_d)
  186. *(.gnu.version_r)
  187. *(.rel.init)
  188. *(.rela.init)
  189. *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
  190. *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
  191. *(.rela.fini)
  192. *(.rel.fini)
  193. *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
  194. *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
  195. *(.rel.data.rel.ro*)
  196. *(.rela.data.rel.ro*)
  197. *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
  198. *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
  199. *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
  200. *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
  201. *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
  202. *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
  203. *(.rel.ctors)
  204. *(.rela.ctors)
  205. *(.rel.dtors)
  206. *(.rela.dtors)
  207. *(.rel.got)
  208. *(.rela.got)
  209. *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
  210. *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
  211. *(.rel.plt)
  212. *(.rela.plt)
  213. KEEP (*(.init))
  214. *(.plt)
  215. *(.text._unhandled_interrupt .text.udd_interrupt .stub .gnu.linkonce.t.*)
  216. KEEP (*(.text.*personality*))
  217. /* .gnu.warning sections are handled specially by elf32.em. */
  218. *(.gnu.warning)
  219. KEEP (*(.fini))
  220. PROVIDE (__etext = .);
  221. PROVIDE (_etext = .);
  222. PROVIDE (etext = .);
  223. *(.rodata .rodata.* .gnu.linkonce.r.*)
  224. *(.rodata1)
  225. *(.eh_frame_hdr)
  226. KEEP (*(.eh_frame))
  227. KEEP (*(.gcc_except_table)) *(.gcc_except_table.*)
  228. } >INTRAM :CONST_INTRAM_AT_FLASH
  229. . = ALIGN(8);
  230. _econst = .;
  231. /* Stabs debugging sections. */
  232. .stab 0 : { *(.stab) }
  233. .stabstr 0 : { *(.stabstr) }
  234. .stab.excl 0 : { *(.stab.excl) }
  235. .stab.exclstr 0 : { *(.stab.exclstr) }
  236. .stab.index 0 : { *(.stab.index) }
  237. .stab.indexstr 0 : { *(.stab.indexstr) }
  238. .comment 0 : { *(.comment) }
  239. /* DWARF debug sections.
  240. Symbols in the DWARF debugging sections are relative to the beginning
  241. of the section so we begin them at 0. */
  242. /* DWARF 1 */
  243. .debug 0 : { *(.debug) }
  244. .line 0 : { *(.line) }
  245. /* GNU DWARF 1 extensions */
  246. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  247. .debug_sfnames 0 : { *(.debug_sfnames) }
  248. /* DWARF 1.1 and DWARF 2 */
  249. .debug_aranges 0 : { *(.debug_aranges) }
  250. .debug_pubnames 0 : { *(.debug_pubnames) }
  251. /* DWARF 2 */
  252. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  253. .debug_abbrev 0 : { *(.debug_abbrev) }
  254. .debug_line 0 : { *(.debug_line) }
  255. .debug_frame 0 : { *(.debug_frame) }
  256. .debug_str 0 : { *(.debug_str) }
  257. .debug_loc 0 : { *(.debug_loc) }
  258. .debug_macinfo 0 : { *(.debug_macinfo) }
  259. /* SGI/MIPS DWARF 2 extensions */
  260. .debug_weaknames 0 : { *(.debug_weaknames) }
  261. .debug_funcnames 0 : { *(.debug_funcnames) }
  262. .debug_typenames 0 : { *(.debug_typenames) }
  263. .debug_varnames 0 : { *(.debug_varnames) }
  264. /DISCARD/ : { *(.note.GNU-stack) }
  265. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement