1/* 2 * Copyright (c) 2006-2023, RT-Thread Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Change Logs: 7 * Date Author Notes 8 */ 9 10INCLUDE "link_stacksize.lds" 11 12/* 13 * The OUTPUT_ARCH command specifies the machine architecture where the 14 * argument is one of the names used in the Kendryte library. 15 */ 16OUTPUT_ARCH( "riscv" ) 17 18MEMORY 19{ 20 /* 6M SRAM */ 21 SRAM : ORIGIN = 0x80000000, LENGTH = 0x600000 22} 23 24ENTRY(_start) 25SECTIONS 26{ 27 . = 0x80000000 ; 28 29 /* __STACKSIZE__ = 4096; */ 30 31 .start : 32 { 33 *(.start); 34 } > SRAM 35 36 . = ALIGN(8); 37 38 .text : 39 { 40 *(.text) /* remaining code */ 41 *(.text.*) /* remaining code */ 42 *(.rodata) /* read-only data (constants) */ 43 *(.rodata*) 44 *(.glue_7) 45 *(.glue_7t) 46 *(.gnu.linkonce.t*) 47 48 . = ALIGN(8); 49 50 PROVIDE(__ctors_start__ = .); 51 /* old GCC version uses .ctors */ 52 KEEP(*(SORT(.ctors.*))) 53 KEEP(*(.ctors)) 54 /* new GCC version uses .init_array */ 55 KEEP (*(SORT(.init_array.*))) 56 KEEP (*(.init_array)) 57 PROVIDE(__ctors_end__ = .); 58 59 60 /* section information for finsh shell */ 61 . = ALIGN(8); 62 __fsymtab_start = .; 63 KEEP(*(FSymTab)) 64 __fsymtab_end = .; 65 . = ALIGN(8); 66 __vsymtab_start = .; 67 KEEP(*(VSymTab)) 68 __vsymtab_end = .; 69 . = ALIGN(8); 70 71 /* section information for initial. */ 72 . = ALIGN(8); 73 __rt_init_start = .; 74 KEEP(*(SORT(.rti_fn*))) 75 __rt_init_end = .; 76 . = ALIGN(8); 77 78 79 __spi_func_start = .; 80 KEEP(*(.spi_call)) 81 __spi_func_end = .; 82 83 . = ALIGN(8); 84 85 __rt_utest_tc_tab_start = .; 86 KEEP(*(UtestTcTab)) 87 __rt_utest_tc_tab_end = .; 88 89 . = ALIGN(8); 90 _etext = .; 91 } > SRAM 92 93 .eh_frame_hdr : 94 { 95 *(.eh_frame_hdr) 96 *(.eh_frame_entry) 97 } > SRAM 98 .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } > SRAM 99 100 . = ALIGN(8); 101 102 .data : 103 { 104 *(.data) 105 *(.data.*) 106 107 *(.data1) 108 *(.data1.*) 109 110 . = ALIGN(8); 111 PROVIDE( __global_pointer$ = . + 0x800 ); 112 113 *(.sdata) 114 *(.sdata.*) 115 116 PROVIDE(__dtors_start__ = .); 117 KEEP(*(SORT(.dtors.*))) 118 KEEP(*(.dtors)) 119 PROVIDE(__dtors_end__ = .); 120 121 } > SRAM 122 123 /* stack for dual core */ 124 .stack : 125 { 126 . = ALIGN(64); 127 __stack_start__ = .; 128 129 . += __STACKSIZE__; 130 __stack_cpu0 = .; 131 PROVIDE( __rt_rvstack = .); 132 133 . += __STACKSIZE__; 134 __stack_cpu1 = .; 135 } > SRAM 136 137 .sbss : 138 { 139 __bss_start = .; 140 *(.sbss) 141 *(.sbss.*) 142 *(.dynsbss) 143 *(.scommon) 144 } > SRAM 145 146 .bss : 147 { 148 *(.bss) 149 *(.bss.*) 150 *(.dynbss) 151 *(COMMON) 152 __bss_end = .; 153 } > SRAM 154 155 _end = .; 156 157 /* Stabs debugging sections. */ 158 .stab 0 : { *(.stab) } 159 .stabstr 0 : { *(.stabstr) } 160 .stab.excl 0 : { *(.stab.excl) } 161 .stab.exclstr 0 : { *(.stab.exclstr) } 162 .stab.index 0 : { *(.stab.index) } 163 .stab.indexstr 0 : { *(.stab.indexstr) } 164 .comment 0 : { *(.comment) } 165 /* DWARF debug sections. 166 * Symbols in the DWARF debugging sections are relative to the beginning 167 * of the section so we begin them at 0. */ 168 /* DWARF 1 */ 169 .debug 0 : { *(.debug) } 170 .line 0 : { *(.line) } 171 /* GNU DWARF 1 extensions */ 172 .debug_srcinfo 0 : { *(.debug_srcinfo) } 173 .debug_sfnames 0 : { *(.debug_sfnames) } 174 /* DWARF 1.1 and DWARF 2 */ 175 .debug_aranges 0 : { *(.debug_aranges) } 176 .debug_pubnames 0 : { *(.debug_pubnames) } 177 /* DWARF 2 */ 178 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } 179 .debug_abbrev 0 : { *(.debug_abbrev) } 180 .debug_line 0 : { *(.debug_line) } 181 .debug_frame 0 : { *(.debug_frame) } 182 .debug_str 0 : { *(.debug_str) } 183 .debug_loc 0 : { *(.debug_loc) } 184 .debug_macinfo 0 : { *(.debug_macinfo) } 185 /* SGI/MIPS DWARF 2 extensions */ 186 .debug_weaknames 0 : { *(.debug_weaknames) } 187 .debug_funcnames 0 : { *(.debug_funcnames) } 188 .debug_typenames 0 : { *(.debug_typenames) } 189 .debug_varnames 0 : { *(.debug_varnames) } 190} 191