gcc_csky.ld 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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.h
  18. * @brief csky linker file for PHOBOS
  19. * @version V1.0
  20. * @date 02. June 2017
  21. ******************************************************************************/
  22. MEMORY
  23. {
  24. I-SRAM : ORIGIN = 0x0 , LENGTH = 0x40000 /* I-SRAM 256KB */
  25. D-SRAM : ORIGIN = 0x20000000 , LENGTH = 0xc0000 /* D-SRAM 768KB */
  26. O-SRAM : ORIGIN = 0x50000000 , LENGTH = 0x800000 /* off-chip SRAM 8MB */
  27. SRAM : ORIGIN = 0x60000000 , LENGTH = 0x20000 /* on-chip SRAM 128KB */
  28. }
  29. PROVIDE (__StackTop = 0x200c0000 - 0x8);
  30. PROVIDE (Stack_Size = 0x1000);
  31. REGION_ALIAS("REGION_TEXT", I-SRAM);
  32. REGION_ALIAS("REGION_RODATA", I-SRAM);
  33. REGION_ALIAS("REGION_CUSTOM1", D-SRAM);
  34. REGION_ALIAS("REGION_CUSTOM2", D-SRAM);
  35. REGION_ALIAS("REGION_DATA", D-SRAM);
  36. REGION_ALIAS("REGION_BSS", D-SRAM);
  37. ENTRY(Reset_Handler)
  38. SECTIONS
  39. {
  40. .text : AT(ADDR(.text)){
  41. . = ALIGN(0x4) ;
  42. __stext = . ;
  43. KEEP(*startup.o(*.text*))
  44. *(.text)
  45. *(.text*)
  46. *(.text.*)
  47. *(.gnu.warning)
  48. *(.stub)
  49. *(.gnu.linkonce.t*)
  50. *(.glue_7t)
  51. *(.glue_7)
  52. *(.jcr)
  53. *(.init)
  54. *(.fini)
  55. . = ALIGN (4) ;
  56. PROVIDE(__ctbp = .);
  57. *(.call_table_data)
  58. *(.call_table_text)
  59. /* section information for finsh shell */
  60. . = ALIGN(4);
  61. __fsymtab_start = .;
  62. KEEP(*(FSymTab))
  63. __fsymtab_end = .;
  64. . = ALIGN(4);
  65. __vsymtab_start = .;
  66. KEEP(*(VSymTab))
  67. __vsymtab_end = .;
  68. . = ALIGN(4);
  69. /* section information for initial. */
  70. . = ALIGN(4);
  71. __rt_init_start = .;
  72. KEEP(*(SORT(.rti_fn*)))
  73. __rt_init_end = .;
  74. . = ALIGN(4);
  75. . = ALIGN(0x10) ;
  76. __etext = . ;
  77. } > REGION_TEXT
  78. .eh_frame_hdr : {
  79. *(.eh_frame_hdr)
  80. } > REGION_TEXT
  81. .eh_frame : ONLY_IF_RO {
  82. KEEP (*(.eh_frame))
  83. } > REGION_TEXT
  84. .gcc_except_table : ONLY_IF_RO {
  85. *(.gcc_except_table .gcc_except_table.*)
  86. } > REGION_TEXT
  87. .rodata :{
  88. . = ALIGN(0x4) ;
  89. __srodata = .;
  90. *(.rdata)
  91. *(.rdata*)
  92. *(.rdata1)
  93. *(.rdata.*)
  94. *(.rodata)
  95. *(.rodata1)
  96. *(.rodata*)
  97. *(.rodata.*)
  98. *(.rodata.str1.4)
  99. . = ALIGN(0x4) ;
  100. __ctor_start__ = .;
  101. KEEP (*(SORT(.ctors.*)))
  102. KEEP (*(.ctors))
  103. __ctor_end__ = .;
  104. KEEP (*(SORT(.dtors.*)))
  105. KEEP (*(.dtors))
  106. __dtor_end__ = .;
  107. . = ALIGN(0x4) ;
  108. __erodata = .;
  109. __rodata_end__ = .;
  110. } > REGION_RODATA
  111. .data : {
  112. . = ALIGN(0x4) ;
  113. __sdata = . ;
  114. __data_start__ = . ;
  115. data_start = . ;
  116. KEEP(*startup.o(*.vectors*))
  117. *(.got.plt)
  118. *(.got)
  119. *(.gnu.linkonce.r*)
  120. *(.data)
  121. *(.data*)
  122. *(.data1)
  123. *(.data.*)
  124. *(.gnu.linkonce.d*)
  125. *(.data1)
  126. *(.gcc_except_table)
  127. *(.gcc_except_table*)
  128. __start_init_call = .;
  129. *(.initcall.init)
  130. __stop_init_call = .;
  131. __start_cmd = .;
  132. *(.bootloaddata.cmd)
  133. . = ALIGN(4) ;
  134. __stop_cmd = .;
  135. __global_pointer$ = .;
  136. *(.sdata)
  137. *(.sdata.*)
  138. *(.gnu.linkonce.s.*)
  139. *(__libc_atexit)
  140. *(__libc_subinit)
  141. *(__libc_subfreeres)
  142. *(.note.ABI-tag)
  143. __edata = .;
  144. __data_end__ = .;
  145. . = ALIGN(0x4) ;
  146. } > REGION_DATA AT > REGION_RODATA
  147. .eh_frame : ONLY_IF_RW {
  148. KEEP (*(.eh_frame))
  149. } > REGION_DATA AT > REGION_RODATA
  150. .gcc_except_table : ONLY_IF_RW {
  151. *(.gcc_except_table .gcc_except_table.*)
  152. __edata = .;
  153. __data_end__ = .;
  154. } > REGION_DATA AT > REGION_RODATA
  155. .bss : {
  156. . = ALIGN(0x4) ;
  157. __sbss = ALIGN(0x4) ;
  158. __bss_start__ = . ;
  159. *(.dynsbss)
  160. *(.sbss)
  161. *(.sbss.*)
  162. *(.scommon)
  163. *(.dynbss)
  164. *(.bss)
  165. *(.bss.*)
  166. *(COMMON)
  167. . = ALIGN(0x4) ;
  168. __ebss = . ;
  169. __end = . ;
  170. end = . ;
  171. __bss_end__ = .;
  172. } > REGION_BSS
  173. /* End of uninitalized data segement */
  174. PROVIDE(end = .);
  175. }