1/* 2 * Copyright (c) 2023 Institute of Parallel And Distributed Systems (IPADS), Shanghai Jiao Tong University (SJTU) 3 * Licensed under the Mulan PSL v2. 4 * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 * You may obtain a copy of Mulan PSL v2 at: 6 * http://license.coscl.org.cn/MulanPSL2 7 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR 8 * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR 9 * PURPOSE. 10 * See the Mulan PSL v2 for more details. 11 */ 12 13ENTRY(_start) 14 15PHDRS 16{ 17 text PT_LOAD FLAGS(5); /* FLAGS: R-X */ 18 rodata PT_LOAD FLAGS(4); /* FLAGS: R-- */ 19 data PT_LOAD FLAGS(6); /* FALGS: RW- */ 20} 21 22SECTIONS 23{ 24 . = 0x400000; 25 26 .text : ALIGN(4K) { 27 *(.text*) 28 } : text 29 30 .rodata : ALIGN(4K) { 31 *(.rodata*) 32 } : rodata 33 34 .data : ALIGN(4K) { 35 *(.data*) 36 } : data 37 38 .bss : ALIGN(4K) { 39 *(.bss*) 40 } : data 41 42 .init_array : ALIGN(4K) { 43 __init_array_start = .; 44 *(SORT_BY_INIT_PRIORITY(.init_array.*)) *(.init_array) 45 *(SORT_BY_INIT_PRIORITY(.ctors.*)) 46 } : data 47 __init_array_end = .; 48 49 .fini_array : ALIGN(4K) { 50 __fini_array_start = .; 51 *(SORT_BY_INIT_PRIORITY(.fini_array.*)) *(.fini_array) 52 *(SORT_BY_INIT_PRIORITY(.dtors.*)) 53 } : data 54 __fini_array_end = .; 55} 56 57