bootldr_at91sam7s128.ld 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
  2. OUTPUT_ARCH(arm)
  3. ENTRY(_start)
  4. MEMORY { /* memory map of AT91SAM7S128 */
  5. ROM (rx) : ORIGIN = 0x00100000, LENGTH = 128k
  6. RAM (rwx) : ORIGIN = 0x00200000, LENGTH = 32k
  7. }
  8. /* The sizes of the stacks used by the application. NOTE: you need to adjust */
  9. C_STACK_SIZE = 1024;
  10. IRQ_STACK_SIZE = 0;
  11. FIQ_STACK_SIZE = 0;
  12. SVC_STACK_SIZE = 0;
  13. ABT_STACK_SIZE = 0;
  14. UND_STACK_SIZE = 0;
  15. SECTIONS {
  16. .reset : {
  17. *startup.o (.text) /* startup code (ARM vectors and reset handler) */
  18. . = ALIGN(0x4);
  19. } >ROM
  20. .fastcode : {
  21. __fastcode_load = LOADADDR (.fastcode);
  22. __fastcode_start = .;
  23. *(.glue_7t) *(.glue_7)
  24. *isr.o (.text.*)
  25. *(.text.fastcode)
  26. /* add other modules here ... */
  27. . = ALIGN (4);
  28. __fastcode_end = .;
  29. } >RAM AT>ROM
  30. .text : {
  31. CREATE_OBJECT_SYMBOLS
  32. *(.text .text.* .gnu.linkonce.t.*)
  33. *(.plt)
  34. *(.gnu.warning)
  35. *(.glue_7t) *(.glue_7) /* NOTE: placed already in .fastcode */
  36. . = ALIGN (4);
  37. /* These are for static constructors and destructors under ELF */
  38. KEEP (*crtbegin.o(.ctors))
  39. KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
  40. KEEP (*(SORT(.ctors.*)))
  41. KEEP (*crtend.o(.ctors))
  42. KEEP (*crtbegin.o(.dtors))
  43. KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
  44. KEEP (*(SORT(.dtors.*)))
  45. KEEP (*crtend.o(.dtors))
  46. *(.rodata .rodata.* .gnu.linkonce.r.*)
  47. *(.ARM.extab* .gnu.linkonce.armextab.*)
  48. *(.gcc_except_table)
  49. *(.eh_frame_hdr)
  50. *(.eh_frame)
  51. *(.init)
  52. *(.fini)
  53. PROVIDE_HIDDEN (__preinit_array_start = .);
  54. KEEP (*(.preinit_array))
  55. PROVIDE_HIDDEN (__preinit_array_end = .);
  56. PROVIDE_HIDDEN (__init_array_start = .);
  57. KEEP (*(SORT(.init_array.*)))
  58. KEEP (*(.init_array))
  59. PROVIDE_HIDDEN (__init_array_end = .);
  60. PROVIDE_HIDDEN (__fini_array_start = .);
  61. KEEP (*(.fini_array))
  62. KEEP (*(SORT(.fini_array.*)))
  63. PROVIDE_HIDDEN (__fini_array_end = .);
  64. } >ROM
  65. /* .ARM.exidx is sorted, so has to go in its own output section. */
  66. .ARM.exidx : {
  67. __exidx_start = .;
  68. *(.ARM.exidx* .gnu.linkonce.armexidx.*)
  69. __exidx_end = .;
  70. } >ROM
  71. _etext = .;
  72. .data : {
  73. __data_load = LOADADDR (.data);
  74. __data_start = .;
  75. KEEP(*(.jcr))
  76. *(.got.plt) *(.got)
  77. *(.shdata)
  78. *(.data .data.* .gnu.linkonce.d.*)
  79. . = ALIGN (4);
  80. _edata = .;
  81. } >RAM AT>ROM
  82. .bss : {
  83. __bss_start__ = . ;
  84. *(.shbss)
  85. *(.bss .bss.* .gnu.linkonce.b.*)
  86. *(COMMON)
  87. . = ALIGN (8);
  88. __bss_end__ = .;
  89. } >RAM
  90. .stack : {
  91. __stack_start__ = . ;
  92. . += IRQ_STACK_SIZE;
  93. . = ALIGN (4);
  94. __irq_stack_top__ = . ;
  95. . += FIQ_STACK_SIZE;
  96. . = ALIGN (4);
  97. __fiq_stack_top__ = . ;
  98. . += SVC_STACK_SIZE;
  99. . = ALIGN (4);
  100. __svc_stack_top__ = . ;
  101. . += ABT_STACK_SIZE;
  102. . = ALIGN (4);
  103. __abt_stack_top__ = . ;
  104. . += UND_STACK_SIZE;
  105. . = ALIGN (4);
  106. __und_stack_top__ = . ;
  107. . += C_STACK_SIZE;
  108. . = ALIGN (4);
  109. __c_stack_top__ = . ;
  110. __stack_end__ = .;
  111. } >RAM
  112. _end = . ;
  113. __end = . ;
  114. PROVIDE(end = .);
  115. .stab 0 (NOLOAD) : {
  116. *(.stab)
  117. }
  118. .stabstr 0 (NOLOAD) : {
  119. *(.stabstr)
  120. }
  121. /* DWARF debug sections.
  122. * Symbols in the DWARF debugging sections are relative to the beginning
  123. * of the section so we begin them at 0.
  124. */
  125. /* DWARF 1 */
  126. .debug 0 : { *(.debug) }
  127. .line 0 : { *(.line) }
  128. /* GNU DWARF 1 extensions */
  129. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  130. .debug_sfnames 0 : { *(.debug_sfnames) }
  131. /* DWARF 1.1 and DWARF 2 */
  132. .debug_aranges 0 : { *(.debug_aranges) }
  133. .debug_pubnames 0 : { *(.debug_pubnames) }
  134. /* DWARF 2 */
  135. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  136. .debug_abbrev 0 : { *(.debug_abbrev) }
  137. .debug_line 0 : { *(.debug_line) }
  138. .debug_frame 0 : { *(.debug_frame) }
  139. .debug_str 0 : { *(.debug_str) }
  140. .debug_loc 0 : { *(.debug_loc) }
  141. .debug_macinfo 0 : { *(.debug_macinfo) }
  142. /* SGI/MIPS DWARF 2 extensions */
  143. .debug_weaknames 0 : { *(.debug_weaknames) }
  144. .debug_funcnames 0 : { *(.debug_funcnames) }
  145. .debug_typenames 0 : { *(.debug_typenames) }
  146. .debug_varnames 0 : { *(.debug_varnames) }
  147. .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
  148. .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) }
  149. /DISCARD/ : { *(.note.GNU-stack) }
  150. }