rtthread-mb9bf506.ld 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. /* Linker script to configure memory regions
  2. *
  3. * Version:CodeSourcery Sourcery G++ Lite 2007q3-53
  4. * BugURL:https://support.codesourcery.com/GNUToolchain/
  5. *
  6. * Copyright 2007 CodeSourcery.
  7. *
  8. * The authors hereby grant permission to use, copy, modify, distribute,
  9. * and license this software and its documentation for any purpose, provided
  10. * that existing copyright notices are retained in all copies and that this
  11. * notice is included verbatim in any distributions. No written agreement,
  12. * license, or royalty fee is required for any of the authorized uses.
  13. * Modifications to this software may be copyrighted by their authors
  14. * and need not follow the licensing terms described here, provided that
  15. * the new terms are clearly indicated on the first page of each file where
  16. * they apply. */
  17. OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
  18. ENTRY(_start)
  19. SEARCH_DIR(.)
  20. GROUP(-lgcc -lc -lcs3 -lcs3unhosted -lcs3micro)
  21. MEMORY
  22. {
  23. rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00080000 /* 512k */
  24. ram (rwx) : ORIGIN = 0x1FFF8000, LENGTH = 0x00010000 /* 32k */
  25. }
  26. /* These force the linker to search for particular symbols from
  27. * the start of the link process and thus ensure the user's
  28. * overrides are picked up
  29. */
  30. EXTERN(__cs3_reset_cortex_m)
  31. EXTERN(__cs3_interrupt_vector_cortex_m)
  32. EXTERN(__cs3_start_c main __cs3_stack __cs3_stack_size __cs3_heap_end)
  33. PROVIDE(__cs3_stack = __cs3_region_start_ram + __cs3_region_size_ram);
  34. PROVIDE(__cs3_stack_size = __cs3_region_start_ram + __cs3_region_size_ram - _end);
  35. PROVIDE(__cs3_heap_start = _end);
  36. PROVIDE(__cs3_heap_end = __cs3_region_start_ram + __cs3_region_size_ram);
  37. SECTIONS
  38. {
  39. .text :
  40. {
  41. CREATE_OBJECT_SYMBOLS
  42. __cs3_region_start_rom = .;
  43. *(.cs3.region-head.rom)
  44. __cs3_interrupt_vector = __cs3_interrupt_vector_cortex_m;
  45. *(.cs3.interrupt_vector)
  46. /* Make sure we pulled in an interrupt vector. */
  47. ASSERT (. != __cs3_interrupt_vector_cortex_m, "No interrupt vector");
  48. *(.rom)
  49. *(.rom.b)
  50. __cs3_reset = __cs3_reset_cortex_m;
  51. *(.cs3.reset)
  52. /* Make sure we pulled in some reset code. */
  53. ASSERT (. != __cs3_reset, "No reset code");
  54. *(.text .text.* .gnu.linkonce.t.*)
  55. *(.plt)
  56. *(.gnu.warning)
  57. *(.glue_7t) *(.glue_7) *(.vfp11_veneer)
  58. *(.rodata .rodata.* .gnu.linkonce.r.*)
  59. *(.ARM.extab* .gnu.linkonce.armextab.*)
  60. *(.gcc_except_table)
  61. *(.eh_frame_hdr)
  62. *(.eh_frame)
  63. . = ALIGN(4);
  64. KEEP(*(.init))
  65. . = ALIGN(4);
  66. __preinit_array_start = .;
  67. KEEP (*(.preinit_array))
  68. __preinit_array_end = .;
  69. . = ALIGN(4);
  70. __init_array_start = .;
  71. KEEP (*(SORT(.init_array.*)))
  72. KEEP (*(.init_array))
  73. __init_array_end = .;
  74. . = ALIGN(0x4);
  75. KEEP (*crtbegin.o(.ctors))
  76. KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
  77. KEEP (*(SORT(.ctors.*)))
  78. KEEP (*crtend.o(.ctors))
  79. . = ALIGN(4);
  80. KEEP(*(.fini))
  81. . = ALIGN(4);
  82. __fini_array_start = .;
  83. KEEP (*(.fini_array))
  84. KEEP (*(SORT(.fini_array.*)))
  85. __fini_array_end = .;
  86. KEEP (*crtbegin.o(.dtors))
  87. KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
  88. KEEP (*(SORT(.dtors.*)))
  89. KEEP (*crtend.o(.dtors))
  90. . = ALIGN(4);
  91. __cs3_regions = .;
  92. LONG (0)
  93. LONG (__cs3_region_init_ram)
  94. LONG (__cs3_region_start_ram)
  95. LONG (__cs3_region_init_size_ram)
  96. LONG (__cs3_region_zero_size_ram)
  97. /* section information for finsh shell */
  98. . = ALIGN(4);
  99. __fsymtab_start = .;
  100. KEEP(*(FSymTab))
  101. __fsymtab_end = .;
  102. . = ALIGN(4);
  103. __vsymtab_start = .;
  104. KEEP(*(VSymTab))
  105. __vsymtab_end = .;
  106. . = ALIGN(4);
  107. }
  108. /* .ARM.exidx is sorted, so has to go in its own output section. */
  109. __exidx_start = .;
  110. .ARM.exidx :
  111. {
  112. *(.ARM.exidx* .gnu.linkonce.armexidx.*)
  113. } >rom
  114. __exidx_end = .;
  115. .text.align :
  116. {
  117. . = ALIGN(8);
  118. _etext = .;
  119. } >rom
  120. __cs3_region_size_rom = LENGTH(rom);
  121. __cs3_region_num = 1;
  122. .data :
  123. {
  124. __cs3_region_start_ram = .;
  125. *(.cs3.region-head.ram)
  126. KEEP(*(.jcr))
  127. *(.got.plt) *(.got)
  128. *(.shdata)
  129. *(.data .data.* .gnu.linkonce.d.*)
  130. *(.ram)
  131. . = ALIGN (8);
  132. _edata = .;
  133. } >ram AT>rom
  134. .bss :
  135. {
  136. *(.shbss)
  137. *(.bss .bss.* .gnu.linkonce.b.*)
  138. *(COMMON)
  139. *(.ram.b)
  140. . = ALIGN (8);
  141. _end = .;
  142. __end = .;
  143. } >ram AT>rom
  144. .heap :
  145. {
  146. *(.heap)
  147. } >ram
  148. __bss_end = .;
  149. .stack (__cs3_stack - __cs3_stack_size) :
  150. {
  151. *(.stack)
  152. } >ram
  153. __cs3_region_init_ram = LOADADDR (.data);
  154. __cs3_region_init_size_ram = _edata - __cs3_region_start_ram;
  155. __cs3_region_zero_size_ram = _end - _edata;
  156. __cs3_region_size_ram = LENGTH(ram);
  157. __cs3_region_num = 1;
  158. .stab 0 (NOLOAD) : { *(.stab) }
  159. .stabstr 0 (NOLOAD) : { *(.stabstr) }
  160. /* DWARF debug sections.
  161. * Symbols in the DWARF debugging sections are relative to the beginning
  162. * of the section so we begin them at 0. */
  163. /* DWARF 1 */
  164. .debug 0 : { *(.debug) }
  165. .line 0 : { *(.line) }
  166. /* GNU DWARF 1 extensions */
  167. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  168. .debug_sfnames 0 : { *(.debug_sfnames) }
  169. /* DWARF 1.1 and DWARF 2 */
  170. .debug_aranges 0 : { *(.debug_aranges) }
  171. .debug_pubnames 0 : { *(.debug_pubnames) }
  172. /* DWARF 2 */
  173. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  174. .debug_abbrev 0 : { *(.debug_abbrev) }
  175. .debug_line 0 : { *(.debug_line) }
  176. .debug_frame 0 : { *(.debug_frame) }
  177. .debug_str 0 : { *(.debug_str) }
  178. .debug_loc 0 : { *(.debug_loc) }
  179. .debug_macinfo 0 : { *(.debug_macinfo) }
  180. /* SGI/MIPS DWARF 2 extensions */
  181. .debug_weaknames 0 : { *(.debug_weaknames) }
  182. .debug_funcnames 0 : { *(.debug_funcnames) }
  183. .debug_typenames 0 : { *(.debug_typenames) }
  184. .debug_varnames 0 : { *(.debug_varnames) }
  185. .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
  186. .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) }
  187. /DISCARD/ : { *(.note.GNU-stack) }
  188. }