1 /* 2 * Copyright (C) 2017-2024 Alibaba Group Holding Limited 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19MEMORY 20{ 21 DRAM : ORIGIN = 0x00000000, LENGTH = 0x100000 /* on-chip SRAM 1*1MB */ 22} 23 24__min_heap_size = 0x200; 25PROVIDE (__ram_end = 0x00100000 - 0x8); 26PROVIDE (__heap_end = __ram_end); 27 28REGION_ALIAS("REGION_TEXT", DRAM); 29REGION_ALIAS("REGION_RODATA", DRAM); 30REGION_ALIAS("REGION_DATA", DRAM); 31REGION_ALIAS("REGION_BSS", DRAM); 32 33ENTRY(Reset_Handler) 34SECTIONS 35{ 36 .text : { 37 . = ALIGN(0x4) ; 38 __stext = . ; 39 KEEP(*startup.o(*.text)) 40 KEEP(*startup.o(*.vectors)) 41 KEEP(*vectors.o(*.text)) 42 KEEP(*(.text.entry)) 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(0x4) ; 55 PROVIDE(__ctbp = .); 56 *(.call_table_data) 57 *(.call_table_text) 58 . = ALIGN(0x4) ; 59 __etext = . ; 60 } > REGION_TEXT 61 .gcc_except_table : ONLY_IF_RO { 62 *(.gcc_except_table .gcc_except_table.*) 63 } > REGION_TEXT 64 .rodata : { 65 . = ALIGN(0x4) ; 66 __srodata = .; 67 *(.rdata) 68 *(.rdata*) 69 *(.rdata1) 70 *(.rdata.*) 71 *(.rodata) 72 *(.rodata1) 73 *(.rodata*) 74 *(.rodata.*) 75 *(.rodata.str1.4) 76 *(.srodata*) 77 . = ALIGN(0x4) ; 78 79 __init_array_start = .; 80 __ctors_start__ = .; 81 KEEP (*(SORT(.init_array.*))) 82 KEEP (*(.init_array)) 83 __init_array_end = .; 84 __ctors_end__ = .; 85 86 __fini_array_start = .; 87 __dtors_start__ = .; 88 KEEP (*(SORT(.fini_array.*))) 89 KEEP (*(.fini_array)) 90 __fini_array_end = .; 91 __dtors_end__ = .; 92 93 __ctor_start__ = .; 94 KEEP (*(SORT(.ctors.*))) 95 KEEP (*(.ctors)) 96 __ctor_end__ = .; 97 KEEP (*(SORT(.dtors.*))) 98 KEEP (*(.dtors)) 99 __dtor_end__ = .; 100 . = ALIGN(0x4) ; 101/*****************************************/ 102 /* section information for finsh shell */ 103 . = ALIGN(0x4); 104 __fsymtab_start = .; 105 KEEP(*(FSymTab)) 106 __fsymtab_end = .; 107 . = ALIGN(0x4); 108 __vsymtab_start = .; 109 KEEP(*(VSymTab)) 110 __vsymtab_end = .; 111 . = ALIGN(0x4); 112 113 /* section information for initial. */ 114 __rt_init_start = .; 115 KEEP(*(SORT(.rti_fn*))) 116 __rt_init_end = .; 117 . = ALIGN(0x4) ; 118 119 /* section information for at utest */ 120 __rt_utest_tc_tab_start = .; 121 KEEP(*(UtestTcTab)) 122 __rt_utest_tc_tab_end = .; 123 . = ALIGN(0x4); 124 125 /* section information for at server */ 126 . = ALIGN(0x4); 127 __rtatcmdtab_start = .; 128 KEEP(*(RtAtCmdTab)) 129 __rtatcmdtab_end = .; 130 . = ALIGN(0x4); 131 132 /* section information for modules */ 133 . = ALIGN(0x4); 134 __rtmsymtab_start = .; 135 KEEP(*(RTMSymTab)) 136 __rtmsymtab_end = .; 137 138 /* section information for uPRC */ 139 . = ALIGN(0x4); 140 __uRPCSvcTab_start = .; 141 KEEP(*(uRPCSvcTab)) 142 __uRPCSvcTab_end = .; 143 144 /* section information for var export */ 145 . = ALIGN(0x4); 146 __ve_table_start = .; 147 KEEP(*(SORT(*.VarExpTab.*))) 148 __ve_table_end = .; 149/*****************************************/ 150/************** added drivers **************/ 151 _cli_region_begin = .; 152 KEEP(*(CliRegion)) 153 . = ALIGN(0x4) ; 154 _cli_region_end = .; 155 156 __core_driver_start__ = .; 157 KEEP(*(.core_driver_entry)) 158 . = ALIGN(0x4) ; 159 __core_driver_end__ = .; 160 161 __bus_driver_start__ = .; 162 KEEP(*(*.bus_driver_entry)) 163 __bus_driver_end__ = .; 164 165 __early_driver_start__ = .; 166 KEEP(*(*.early_driver_entry)) 167 __early_driver_end__ = .; 168 169 __vfs_driver_start__ = .; 170 KEEP(*(*.vfs_driver_entry)) 171 __vfs_driver_end__ = .; 172 173 __level0_driver_start__ = .; 174 KEEP(*(*.level0_driver_entry)) 175 __level0_driver_end__ = .; 176 177 __level1_driver_start__ = .; 178 KEEP(*(*.level1_driver_entry)) 179 __level1_driver_end__ = .; 180 181 __level2_driver_start__ = .; 182 KEEP(*(*.level2_driver_entry)) 183 __level2_driver_end__ = .; 184 185 __level3_driver_start__ = .; 186 KEEP(*(*.level3_driver_entry)) 187 __level3_driver_end__ = .; 188 189 __post_driver_start__ = .; 190 KEEP(*(*.post_driver_entry)) 191 __post_driver_end__ = .; 192/************** end of drivers *********/ 193 . = ALIGN(0x4) ; 194 __erodata = .; 195 __rodata_end__ = .; 196 } > REGION_RODATA 197 .data : { 198 . = ALIGN(0x4) ; 199 __sdata = . ; 200 __data_start__ = . ; 201 data_start = . ; 202 *(.got.plt) 203 *(.got) 204 *(.gnu.linkonce.r*) 205 *(.data) 206 *(.data*) 207 *(.data1) 208 *(.data.*) 209 *(.gnu.linkonce.d*) 210 *(.data1) 211 *(.gcc_except_table) 212 *(.gcc_except_table*) 213 __start_init_call = .; 214 *(.initcall.init) 215 __stop_init_call = .; 216 __start_cmd = .; 217 *(.bootloaddata.cmd) 218 . = ALIGN(4) ; 219 __stop_cmd = .; 220 __global_pointer$ = .; 221 *(.sdata) 222 *(.sdata.*) 223 *(.sdata2.*) 224 *(.gnu.linkonce.s.*) 225 *(__libc_atexit) 226 *(__libc_subinit) 227 *(__libc_subfreeres) 228 *(.note.ABI-tag) 229 __edata = .; 230 __data_end__ = .; 231 . = ALIGN(0x4) ; 232 } > REGION_DATA 233 .gcc_except_table : ONLY_IF_RW { 234 *(.gcc_except_table .gcc_except_table.*) 235 __edata = .; 236 __data_end__ = .; 237 } > REGION_DATA 238 .bss : { 239 . = ALIGN(0x4) ; 240 __sbss = ALIGN(0x4) ; 241 __bss_start__ = . ; 242 *(.dynsbss) 243 *(.sbss) 244 *(.sbss.*) 245 *(.scommon) 246 *(.dynbss) 247 *(.bss) 248 *(.bss.*) 249 *(COMMON) 250 . = ALIGN(0x4) ; 251 __ebss = . ; 252 __bss_end__ = .; 253 __end = . ; 254 end = . ; 255 } > REGION_BSS 256 ._user_heap (NOLOAD): { 257 . = ALIGN(0x4) ; 258 *(.stack*) 259 . = ALIGN(0x4) ; 260 __heap_start = .; 261 . += __min_heap_size; 262 . = ALIGN(0x4) ; 263 } > REGION_BSS 264} 265