1/* 2 * Copyright (C) 2022 Huawei Technologies Co., Ltd. 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 13OUTPUT_FORMAT("elf64-littleaarch64", "elf64-bigaarch64", 14 "elf64-littleaarch64") 15OUTPUT_ARCH(aarch64) 16ENTRY(_start) 17SEARCH_DIR("=/home/tcwg-buildslave/workspace/tcwg-make-release/builder_arch/amd64/label/tcwg-x86_64-build/target/aarch64-linux-gnu/_build/builds/destdir/x86_64-unknown-linux-gnu/aarch64-linux-gnu/lib64"); SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/home/tcwg-buildslave/workspace/tcwg-make-release/builder_arch/amd64/label/tcwg-x86_64-build/target/aarch64-linux-gnu/_build/builds/destdir/x86_64-unknown-linux-gnu/aarch64-linux-gnu/lib"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib"); 18SECTIONS 19{ 20 /* Read-only sections, merged into text segment: */ 21 . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS; 22 _start = .; 23 /* This should be the first section after program headers */ 24 .magic : { *(.magic) } 25 .note.gnu.build-id : { *(.note.gnu.build-id) } 26 .hash : { *(.hash) } 27 .gnu.hash : { *(.gnu.hash) } 28 .dynsym : { *(.dynsym) } 29 .dynstr : { *(.dynstr) } 30 .gnu.version : { *(.gnu.version) } 31 .gnu.version_d : { *(.gnu.version_d) } 32 .gnu.version_r : { *(.gnu.version_r) } 33 .rela.dyn : 34 { 35 *(.rela.init) 36 *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) 37 *(.rela.fini) 38 *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) 39 *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) 40 *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) 41 *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) 42 *(.rela.ctors) 43 *(.rela.dtors) 44 *(.rela.got) 45 *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) 46 *(.rela.ifunc) 47 } 48 .rela.plt : 49 { 50 *(.rela.plt) 51 *(.rela.iplt) 52 } 53 .rodata : 54 { 55 *(.rodata .rodata.* .gnu.linkonce.r.*) 56 . = ALIGN(16); 57 PROVIDE (__start___llvm_prf_names = .); 58 *(__llvm_prf_names) 59 PROVIDE (__stop___llvm_prf_names = .); 60 } 61 .rodata1 : { *(.rodata1) } 62 .eh_frame_hdr : { *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*) } 63 .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) *(.eh_frame.*) } 64 .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table 65 .gcc_except_table.*) } 66 .gnu_extab : ONLY_IF_RO { *(.gnu_extab*) } 67 /* These sections are generated by the Sun/Oracle C++ compiler. */ 68 .exception_ranges : ONLY_IF_RO { *(.exception_ranges 69 .exception_ranges*) } 70 /* Make sure the address of text segment is aligned in 4k for xom */ 71 . = ALIGN(0x1000); 72 .init : 73 { 74 KEEP (*(SORT_NONE(.init))) 75 } =0 76 .plt : ALIGN(16) { *(.plt) *(.iplt) } 77 .text : 78 { 79 *(.text.unlikely .text.*_unlikely .text.unlikely.*) 80 *(.text.exit .text.exit.*) 81 *(.text.startup .text.startup.*) 82 *(.text.hot .text.hot.*) 83 *(.text .stub .text.* .gnu.linkonce.t.*) 84 /* .gnu.warning sections are handled specially by elf32.em. */ 85 *(.gnu.warning) 86 } =0 87 .fini : 88 { 89 KEEP (*(SORT_NONE(.fini))) 90 } =0 91 PROVIDE (__etext = .); 92 PROVIDE (_etext = .); 93 PROVIDE (etext = .); 94 /* Adjust the address for the data segment. We want to adjust up to 95 the same address within the page on the next page up. */ 96 . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE)); 97 /* Exception handling */ 98 .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) *(.eh_frame.*) } 99 .gnu_extab : ONLY_IF_RW { *(.gnu_extab) } 100 .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } 101 .exception_ranges : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) } 102 /* Thread Local Storage sections */ 103 .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } 104 .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } 105 .preinit_array : 106 { 107 KEEP (*(.preinit_array)) 108 } 109 .init_array : 110 { 111 PROVIDE_HIDDEN (__init_array_start = .); 112 KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) 113 KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) 114 PROVIDE_HIDDEN (__init_array_end = .); 115 } 116 .fini_array : 117 { 118 PROVIDE_HIDDEN (__fini_array_start = .); 119 KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) 120 KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) 121 PROVIDE_HIDDEN (__fini_array_end = .); 122 } 123 .ctors : 124 { 125 /* gcc uses crtbegin.o to find the start of 126 the constructors, so we make sure it is 127 first. Because this is a wildcard, it 128 doesn't matter if the user does not 129 actually link against crtbegin.o; the 130 linker won't look for a file to match a 131 wildcard. The wildcard also means that it 132 doesn't matter which directory crtbegin.o 133 is in. */ 134 KEEP (*crtbegin.o(.ctors)) 135 KEEP (*crtbegin?.o(.ctors)) 136 /* We don't want to include the .ctor section from 137 the crtend.o file until after the sorted ctors. 138 The .ctor section from the crtend file contains the 139 end of ctors marker and it must be last */ 140 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) 141 KEEP (*(SORT(.ctors.*))) 142 KEEP (*(.ctors)) 143 } 144 .dtors : 145 { 146 KEEP (*crtbegin.o(.dtors)) 147 KEEP (*crtbegin?.o(.dtors)) 148 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) 149 KEEP (*(SORT(.dtors.*))) 150 KEEP (*(.dtors)) 151 } 152 .jcr : { KEEP (*(.jcr)) } 153 .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) } 154 .dynamic : { *(.dynamic) } 155 .got : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) } 156 . = DATA_SEGMENT_RELRO_END (0, .); 157 .data : 158 { 159 PROVIDE (__data_start = .); 160 *(.data .data.* .gnu.linkonce.d.*) 161 PROVIDE (__start___llvm_prf_cnts = .); 162 *(__llvm_prf_cnts) 163 PROVIDE (__stop___llvm_prf_cnts = .); 164 PROVIDE (__start___llvm_prf_data = .); 165 *(__llvm_prf_data) 166 PROVIDE (__stop___llvm_prf_data = .); 167 PROVIDE (__start___llvm_prf_vnds = .); 168 *(__llvm_prf_vnds); 169 PROVIDE (__stop___llvm_prf_vnds = .); 170 SORT(CONSTRUCTORS) 171 } 172 .data1 : { *(.data1) } 173 _edata = .; PROVIDE (edata = .); 174 . = .; 175 __bss_start = .; 176 __bss_start__ = .; 177 TA_BSS_START = .; 178 .bss : 179 { 180 *(.dynbss) 181 *(.bss .bss.* .gnu.linkonce.b.*) 182 *(COMMON) 183 . = ALIGN(. != 0 ? 64 / 8 : 1); 184 } 185 TA_BSS_END = .; 186 _bss_end__ = . ; __bss_end__ = . ; 187 . = ALIGN(64 / 8); 188 . = SEGMENT_START("ldata-segment", .); 189 . = ALIGN(64 / 8); 190 __end__ = . ; 191 _end = .; PROVIDE (end = .); 192 . = DATA_SEGMENT_END (.); 193 /* Stabs debug sections. */ 194 .stab 0 : { *(.stab) } 195 .stabstr 0 : { *(.stabstr) } 196 .stab.excl 0 : { *(.stab.excl) } 197 .stab.exclstr 0 : { *(.stab.exclstr) } 198 .stab.index 0 : { *(.stab.index) } 199 .stab.indexstr 0 : { *(.stab.indexstr) } 200 .comment 0 : { *(.comment) } 201 /* DWARF debug sections. 202 Symbols in the DWARF debug sections are relative to the beginning 203 of the section so we begin them at 0. */ 204 /* DWARF 1 */ 205 .debug 0 : { *(.debug) } 206 .line 0 : { *(.line) } 207 /* GNU DWARF 1 extensions */ 208 .debug_srcinfo 0 : { *(.debug_srcinfo) } 209 .debug_sfnames 0 : { *(.debug_sfnames) } 210 /* DWARF 1.1 and DWARF 2 */ 211 .debug_aranges 0 : { *(.debug_aranges) } 212 .debug_pubnames 0 : { *(.debug_pubnames) } 213 /* DWARF 2 */ 214 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } 215 .debug_abbrev 0 : { *(.debug_abbrev) } 216 .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) } 217 .debug_frame 0 : { *(.debug_frame) } 218 .debug_str 0 : { *(.debug_str) } 219 .debug_loc 0 : { *(.debug_loc) } 220 .debug_macinfo 0 : { *(.debug_macinfo) } 221 /* SGI/MIPS DWARF 2 extensions */ 222 .debug_weaknames 0 : { *(.debug_weaknames) } 223 .debug_funcnames 0 : { *(.debug_funcnames) } 224 .debug_typenames 0 : { *(.debug_typenames) } 225 .debug_varnames 0 : { *(.debug_varnames) } 226 /* DWARF 3 */ 227 .debug_pubtypes 0 : { *(.debug_pubtypes) } 228 .debug_ranges 0 : { *(.debug_ranges) } 229 /* DWARF Extension. */ 230 .debug_macro 0 : { *(.debug_macro) } 231 .debug_addr 0 : { *(.debug_addr) } 232 .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) } 233 .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) } 234 /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) } 235} 236