AIR103.ld 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. /*
  2. * Copyright (C) 2017 C-SKY Microsystems Co., Ltd. All rights reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /******************************************************************************
  17. * @file gcc_csky.ld
  18. * @brief csky linker file
  19. * @version V1.0
  20. * @date 02. June 2017
  21. ******************************************************************************/
  22. MEMORY
  23. {
  24. I-SRAM : ORIGIN = 0x08010800 , LENGTH = 0xCF800 /* I-SRAM 830KB */
  25. D-SRAM : ORIGIN = 0x20000100 , LENGTH = 0x47f00 /* D-SRAM 288KB */
  26. V-SRAM : ORIGIN = 0x20000000 , LENGTH = 0x100 /* off-chip SRAM 8MB */
  27. }
  28. __min_heap_size = 0x2000;
  29. PROVIDE (__ram_end = 0x20028000);
  30. PROVIDE (__heap_end = __ram_end);
  31. REGION_ALIAS("REGION_TEXT", I-SRAM);
  32. REGION_ALIAS("REGION_RODATA", I-SRAM);
  33. REGION_ALIAS("REGION_VDATA", V-SRAM);
  34. REGION_ALIAS("REGION_DATA", D-SRAM);
  35. REGION_ALIAS("REGION_BSS", D-SRAM);
  36. ENTRY(Reset_Handler)
  37. SECTIONS
  38. {
  39. .text : {
  40. . = ALIGN(0x4) ;
  41. KEEP(*startup.o(.vectors))
  42. __stext = . ;
  43. *(.text)
  44. *(.text*)
  45. *(.text.*)
  46. *(.gnu.warning)
  47. *(.stub)
  48. *(.gnu.linkonce.t*)
  49. *(.glue_7t)
  50. *(.glue_7)
  51. *(.jcr)
  52. KEEP (*(.init))
  53. KEEP (*(.fini))
  54. . = ALIGN (4) ;
  55. PROVIDE(__ctbp = .);
  56. *(.call_table_data)
  57. *(.call_table_text)
  58. . = ALIGN(0x10) ;
  59. __etext = . ;
  60. } > REGION_TEXT
  61. .rodata : {
  62. . = ALIGN(0x4) ;
  63. __srodata = .;
  64. *(.rdata)
  65. *(.rdata*)
  66. *(.rdata1)
  67. *(.rdata.*)
  68. *(.rodata)
  69. *(.rodata1)
  70. *(.rodata*)
  71. *(.rodata.*)
  72. *(.rodata.str1.4)
  73. . = ALIGN(0x4) ;
  74. __ctor_start__ = .;
  75. KEEP (*crtbegin.o(.ctors))
  76. KEEP (*crtbegin?.o(.ctors))
  77. KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
  78. KEEP (*(SORT(.ctors.*)))
  79. KEEP (*(.ctors))
  80. __ctor_end__ = .;
  81. KEEP (*crtbegin.o(.dtors))
  82. KEEP (*crtbegin?.o(.dtors))
  83. KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
  84. KEEP (*(SORT(.dtors.*)))
  85. KEEP (*(.dtors))
  86. __dtor_end__ = .;
  87. . = ALIGN(0x4) ;
  88. __erodata = .;
  89. } > REGION_RODATA
  90. .vdata : {
  91. . = ALIGN(0x4) ;
  92. __vdata_start__ = . ;
  93. KEEP(*startup.o(.vdata))
  94. . = ALIGN(0x4) ;
  95. __vdata_end__ = .;
  96. } > REGION_VDATA
  97. .data : {
  98. . = ALIGN(0x4) ;
  99. __sdata = . ;
  100. __data_start__ = . ;
  101. data_start = . ;
  102. *(.got.plt)
  103. *(.got)
  104. *(.gnu.linkonce.r*)
  105. *(.data)
  106. *(.data*)
  107. *(.data1)
  108. *(.data.*)
  109. *(.gnu.linkonce.d*)
  110. *(.data1)
  111. *(.gcc_except_table)
  112. *(.gcc_except_table*)
  113. __start_init_call = .;
  114. *(.initcall.init)
  115. __stop_init_call = .;
  116. __start_cmd = .;
  117. *(.bootloaddata.cmd)
  118. . = ALIGN(4) ;
  119. __stop_cmd = .;
  120. *(.sdata)
  121. *(.sdata.*)
  122. *(.gnu.linkonce.s.*)
  123. *(__libc_atexit)
  124. *(__libc_subinit)
  125. *(__libc_subfreeres)
  126. *(.note.ABI-tag)
  127. . = ALIGN(0x4) ;
  128. __edata = .;
  129. __data_end__ = .;
  130. } > REGION_DATA AT > REGION_RODATA
  131. .bss : {
  132. . = ALIGN(0x4) ;
  133. __sbss = ALIGN(0x4) ;
  134. __bss_start__ = . ;
  135. *(.dynsbss)
  136. *(.sbss)
  137. *(.sbss.*)
  138. *(.scommon)
  139. *(.dynbss)
  140. *(.bss)
  141. *(.bss.*)
  142. *(COMMON)
  143. . = ALIGN(0x4) ;
  144. __ebss = . ;
  145. __end = . ;
  146. end = . ;
  147. __bss_end__ = .;
  148. } > REGION_BSS
  149. ._user_heap : {
  150. . = ALIGN(0x4) ;
  151. __heap_start = .;
  152. . += __min_heap_size;
  153. . = ALIGN(0x4) ;
  154. } > REGION_BSS
  155. .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } > REGION_BSS
  156. .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } > REGION_BSS
  157. .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
  158. .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
  159. .eh_frame_hdr : { *(.eh_frame_hdr) }
  160. .preinit_array :
  161. {
  162. PROVIDE_HIDDEN (__preinit_array_start = .);
  163. KEEP (*(.preinit_array))
  164. PROVIDE_HIDDEN (__preinit_array_end = .);
  165. }
  166. .init_array :
  167. {
  168. PROVIDE_HIDDEN (__init_array_start = .);
  169. KEEP (*(SORT(.init_array.*)))
  170. KEEP (*(.init_array))
  171. PROVIDE_HIDDEN (__init_array_end = .);
  172. }
  173. .fini_array :
  174. {
  175. PROVIDE_HIDDEN (__fini_array_start = .);
  176. KEEP (*(.fini_array))
  177. KEEP (*(SORT(.fini_array.*)))
  178. PROVIDE_HIDDEN (__fini_array_end = .);
  179. }
  180. .junk 0 : { *(.rel*) *(.rela*) }
  181. .stab 0 : { *(.stab) }
  182. .stabstr 0 : { *(.stabstr) }
  183. .stab.excl 0 : { *(.stab.excl) }
  184. .stab.exclstr 0 : { *(.stab.exclstr) }
  185. .stab.index 0 : { *(.stab.index) }
  186. .stab.indexstr 0 : { *(.stab.indexstr) }
  187. .comment 0 : { *(.comment) }
  188. .debug 0 : { *(.debug) }
  189. .line 0 : { *(.line) }
  190. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  191. .debug_sfnames 0 : { *(.debug_sfnames) }
  192. .debug_aranges 0 : { *(.debug_aranges) }
  193. .debug_pubnames 0 : { *(.debug_pubnames) }
  194. .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
  195. .debug_abbrev 0 : { *(.debug_abbrev) }
  196. .debug_line 0 : { *(.debug_line) }
  197. .debug_frame 0 : { *(.debug_frame) }
  198. .debug_str 0 : { *(.debug_str) }
  199. .debug_loc 0 : { *(.debug_loc) }
  200. .debug_macinfo 0 : { *(.debug_macinfo) }
  201. .debug_weaknames 0 : { *(.debug_weaknames) }
  202. .debug_funcnames 0 : { *(.debug_funcnames) }
  203. .debug_typenames 0 : { *(.debug_typenames) }
  204. .debug_varnames 0 : { *(.debug_varnames) }
  205. .debug_pubtypes 0 : { *(.debug_pubtypes) }
  206. .debug_ranges 0 : { *(.debug_ranges) }
  207. .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
  208. /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
  209. }