at91sam9xe512_ram.ld 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. /*
  2. * Copyright (C) 2005-2006 by egnite Software GmbH. All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. *
  8. * 1. Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in the
  12. * documentation and/or other materials provided with the distribution.
  13. * 3. Neither the name of the copyright holders nor the names of
  14. * contributors may be used to endorse or promote products derived
  15. * from this software without specific prior written permission.
  16. *
  17. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  18. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  19. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  20. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  21. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  22. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  23. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  24. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  25. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  26. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  27. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  28. * SUCH DAMAGE.
  29. *
  30. * For additional information see http://www.ethernut.de/
  31. */
  32. /*
  33. * $Id: at91sam9xe512_ram.ld 4477 2012-08-20 17:50:01Z haraldkipp $
  34. */
  35. OUTPUT_ARCH(arm)
  36. ENTRY(_start)
  37. STARTUP(crtat91sam9xe512_ram.o)
  38. SEARCH_DIR(.)
  39. MEMORY
  40. {
  41. iram(rw) : org = 0x00000000, len = 32K
  42. xram(rw) : org = 0x20000000, len = 128M
  43. }
  44. SECTIONS
  45. {
  46. .text :
  47. {
  48. *(.vectors);
  49. /* Initialization code. */
  50. . = ALIGN(16384); KEEP(*(.init0));
  51. . = ALIGN(4); *(.init1.user);
  52. . = ALIGN(4); *(.init1);
  53. . = ALIGN(4); *(.init2.user);
  54. . = ALIGN(4); *(.init2);
  55. . = ALIGN(4); *(.init3.user);
  56. . = ALIGN(4); *(.init3);
  57. . = ALIGN(4); *(.init4.user);
  58. . = ALIGN(4); *(.init4);
  59. /* Exit handling. */
  60. . = ALIGN(4); *(.exit0.user);
  61. . = ALIGN(4); *(.exit0);
  62. /* System and application code. */
  63. . = ALIGN(4); *(.text .text.*);
  64. *(.glue_7t);
  65. . = ALIGN(4);
  66. *(.glue_7);
  67. } > xram
  68. .rodata :
  69. {
  70. *(.rodata .rodata.*)
  71. *(.gnu.linkonce.r.*)
  72. . = ALIGN(4);
  73. } > xram
  74. .eh_frame :
  75. {
  76. KEEP (*(.eh_frame))
  77. . = ALIGN(4);
  78. } > xram
  79. .ctors :
  80. {
  81. PROVIDE(__ctors_start__ = .);
  82. KEEP(*(SORT(.ctors.*)))
  83. KEEP(*(.ctors))
  84. PROVIDE(__ctors_end__ = .);
  85. . = ALIGN(4);
  86. } > xram
  87. .dtors :
  88. {
  89. PROVIDE(__dtors_start__ = .);
  90. KEEP(*(SORT(.dtors.*)))
  91. KEEP(*(.dtors))
  92. PROVIDE(__dtors_end__ = .);
  93. . = ALIGN(4);
  94. } > xram
  95. .data :
  96. {
  97. . = ALIGN(4); *(.data)
  98. . = ALIGN(4); *(.data.*)
  99. . = ALIGN(4); *(.ramfunc);
  100. *(.gnu.linkonce.d*)
  101. SORT(CONSTRUCTORS) /* this entry is in the Anglia example */
  102. /* CONSTRUCTORS */ /* this entry is in the devkitarm script but not in the Anglia example */
  103. . = ALIGN(4);
  104. } > xram
  105. .bss :
  106. {
  107. PROVIDE (__bss_start = .);
  108. *(.bss)
  109. *(.gnu.linkonce.b*)
  110. *(COMMON)
  111. . = ALIGN(4);
  112. PROVIDE (__bss_end = .);
  113. } > xram
  114. .stacks :
  115. {
  116. /* Stacks for exception handlers and low level initialization. */
  117. . = ALIGN(8); *(.stack);
  118. PROVIDE (__stack = .);
  119. /* All RAM beyond this point is occupied by the heap. */
  120. PROVIDE (__heap_start = .);
  121. } > xram
  122. /* Stabs debugging sections. */
  123. .stab 0 : { *(.stab) }
  124. .stabstr 0 : { *(.stabstr) }
  125. .stab.excl 0 : { *(.stab.excl) }
  126. .stab.exclstr 0 : { *(.stab.exclstr) }
  127. .stab.index 0 : { *(.stab.index) }
  128. .stab.indexstr 0 : { *(.stab.indexstr) }
  129. .comment 0 : { *(.comment) }
  130. /* DWARF debug sections.
  131. Symbols in the DWARF debugging sections are relative to the beginning
  132. of the section so we begin them at 0. */
  133. /* DWARF 1 */
  134. .debug 0 : { *(.debug) }
  135. .line 0 : { *(.line) }
  136. /* GNU DWARF 1 extensions */
  137. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  138. .debug_sfnames 0 : { *(.debug_sfnames) }
  139. /* DWARF 1.1 and DWARF 2 */
  140. .debug_aranges 0 : { *(.debug_aranges) }
  141. .debug_pubnames 0 : { *(.debug_pubnames) }
  142. /* DWARF 2 */
  143. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  144. .debug_abbrev 0 : { *(.debug_abbrev) }
  145. .debug_line 0 : { *(.debug_line) }
  146. .debug_frame 0 : { *(.debug_frame) }
  147. .debug_str 0 : { *(.debug_str) }
  148. .debug_loc 0 : { *(.debug_loc) }
  149. .debug_macinfo 0 : { *(.debug_macinfo) }
  150. /* SGI/MIPS DWARF 2 extensions */
  151. .debug_weaknames 0 : { *(.debug_weaknames) }
  152. .debug_funcnames 0 : { *(.debug_funcnames) }
  153. .debug_typenames 0 : { *(.debug_typenames) }
  154. .debug_varnames 0 : { *(.debug_varnames) }
  155. }