AIR101.ld 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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 = 0x1CF800 /* I-SRAM 1854KB */
  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. KEEP (*crtbegin.o(.ctors))
  74. KEEP (*crtbegin?.o(.ctors))
  75. KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
  76. KEEP (*(SORT(.ctors.*)))
  77. KEEP (*(.ctors))
  78. KEEP (*crtbegin.o(.dtors))
  79. KEEP (*crtbegin?.o(.dtors))
  80. KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
  81. KEEP (*(SORT(.dtors.*)))
  82. KEEP (*(.dtors))
  83. . = ALIGN(0x4) ;
  84. __erodata = .;
  85. } > REGION_RODATA
  86. .vdata : {
  87. . = ALIGN(0x4) ;
  88. __vdata_start__ = . ;
  89. KEEP(*startup.o(.vdata))
  90. . = ALIGN(0x4) ;
  91. __vdata_end__ = .;
  92. } > REGION_VDATA
  93. .data : {
  94. . = ALIGN(0x4) ;
  95. __sdata = . ;
  96. __data_start__ = . ;
  97. data_start = . ;
  98. *(.ram_run)
  99. *(.got.plt)
  100. *(.got)
  101. *(.gnu.linkonce.r*)
  102. *(.ram_run)
  103. *(.data)
  104. *(.data*)
  105. *(.data1)
  106. *(.data.*)
  107. *(.gnu.linkonce.d*)
  108. *(.data1)
  109. *(.gcc_except_table)
  110. *(.gcc_except_table*)
  111. __start_init_call = .;
  112. *(.initcall.init)
  113. __stop_init_call = .;
  114. __start_cmd = .;
  115. *(.bootloaddata.cmd)
  116. . = ALIGN(4) ;
  117. __stop_cmd = .;
  118. *(.sdata)
  119. *(.sdata.*)
  120. *(.gnu.linkonce.s.*)
  121. *(__libc_atexit)
  122. *(__libc_subinit)
  123. *(__libc_subfreeres)
  124. *(.note.ABI-tag)
  125. . = ALIGN(0x4) ;
  126. __edata = .;
  127. __data_end__ = .;
  128. } > REGION_DATA AT > REGION_RODATA
  129. .bss : {
  130. . = ALIGN(0x4) ;
  131. __sbss = ALIGN(0x4) ;
  132. __bss_start__ = . ;
  133. *(.dynsbss)
  134. *(.sbss)
  135. *(.sbss.*)
  136. *(.scommon)
  137. *(.dynbss)
  138. *(.bss)
  139. *(.bss.*)
  140. *(COMMON)
  141. . = ALIGN(0x4) ;
  142. __ebss = . ;
  143. __end = . ;
  144. end = . ;
  145. __bss_end__ = .;
  146. . = ALIGN(0x4) ;
  147. *(.heap4)
  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. }