1OUTPUT_ARCH(riscv) 2ENTRY(_start) 3 4SEARCH_DIR(/usr/lib); 5SECTIONS 6{ 7 /* Read-only sections, merged into text segment: */ 8 . = kernbase; 9 /* The load address kernel_lma is set using --defsym= on the command line. */ 10 .text : AT(kernel_lma) 11 { 12 *(.text) 13 *(.stub) 14 /* .gnu.warning sections are handled specially by elf32.em. */ 15 *(.gnu.warning) 16 *(.gnu.linkonce.t*) 17 } =0x9090 18 _etext = .; 19 PROVIDE (etext = .); 20 .fini : { *(.fini) } =0x9090 21 .rodata : { *(.rodata) *(.gnu.linkonce.r*) } 22 .rodata1 : { *(.rodata1) } 23 .interp : { *(.interp) } 24 .hash : { *(.hash) } 25 .dynsym : { *(.dynsym) } 26 .dynstr : { *(.dynstr) } 27 .gnu.version : { *(.gnu.version) } 28 .gnu.version_d : { *(.gnu.version_d) } 29 .gnu.version_r : { *(.gnu.version_r) } 30 .note.gnu.build-id : { 31 PROVIDE (__build_id_start = .); 32 *(.note.gnu.build-id) 33 PROVIDE (__build_id_end = .); 34 } 35 .rel.text : 36 { *(.rel.text) *(.rel.gnu.linkonce.t*) } 37 .rela.text : 38 { *(.rela.text) *(.rela.gnu.linkonce.t*) } 39 .rel.data : 40 { *(.rel.data) *(.rel.gnu.linkonce.d*) } 41 .rela.data : 42 { *(.rela.data) *(.rela.gnu.linkonce.d*) } 43 .rel.rodata : 44 { *(.rel.rodata) *(.rel.gnu.linkonce.r*) } 45 .rela.rodata : 46 { *(.rela.rodata) *(.rela.gnu.linkonce.r*) } 47 .rel.got : { *(.rel.got) } 48 .rela.got : { *(.rela.got) } 49 .rel.ctors : { *(.rel.ctors) } 50 .rela.ctors : { *(.rela.ctors) } 51 .rel.dtors : { *(.rel.dtors) } 52 .rela.dtors : { *(.rela.dtors) } 53 .rel.init : { *(.rel.init) } 54 .rela.init : { *(.rela.init) } 55 .rel.fini : { *(.rel.fini) } 56 .rela.fini : { *(.rela.fini) } 57 .rel.bss : { *(.rel.bss) } 58 .rela.bss : { *(.rela.bss) } 59 .rel.plt : { *(.rel.plt) } 60 .rela.plt : { *(.rela.plt) } 61 .init : { *(.init) } =0x9090 62 .plt : { *(.plt) } 63 64 /* Adjust the address for the data segment. We want to adjust up to 65 the same address within the page on the next page up. */ 66 . = ALIGN(0x1000) + (. & (0x1000 - 1)) ; 67 .data : 68 { 69 *(.data) 70 *(.gnu.linkonce.d*) 71 } 72 .data1 : { *(.data1) } 73 . = ALIGN(32 / 8); 74 .init_array : 75 { 76 PROVIDE_HIDDEN (__init_array_start = .); 77 KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*))) 78 KEEP (*(.init_array)) 79 PROVIDE_HIDDEN (__init_array_end = .); 80 } 81 .fini_array : 82 { 83 PROVIDE_HIDDEN (__fini_array_start = .); 84 KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*))) 85 KEEP (*(.fini_array)) 86 PROVIDE_HIDDEN (__fini_array_end = .); 87 } 88 _start_ctors = .; 89 PROVIDE (start_ctors = .); 90 .ctors : 91 { 92 *(.ctors) 93 } 94 _stop_ctors = .; 95 PROVIDE (stop_ctors = .); 96 .dtors : 97 { 98 *(.dtors) 99 } 100 .got : { *(.got.plt) *(.got) } 101 .dynamic : { *(.dynamic) } 102 /* We want the small data sections together, so single-instruction offsets 103 can access them all, and initialized data all before uninitialized, so 104 we can shorten the on-disk segment size. */ 105 . = ALIGN(8); 106 .sdata : 107 { 108 __global_pointer$ = . + 0x800; 109 *(.sdata) 110 } 111 _edata = .; 112 PROVIDE (edata = .); 113 /* Ensure __bss_start is associated with the next section in case orphan 114 sections are placed directly after .sdata, as has been seen to happen with 115 LLD. */ 116 . = ALIGN(8); 117 __bss_start = .; 118 .sbss : { *(.sbss) *(.scommon) } 119 .bss : 120 { 121 *(.dynbss) 122 *(.bss) 123 *(COMMON) 124 } 125 . = ALIGN(8); 126 _end = . ; 127 PROVIDE (end = .); 128 /* Stabs debugging sections. */ 129 .stab 0 : { *(.stab) } 130 .stabstr 0 : { *(.stabstr) } 131 .stab.excl 0 : { *(.stab.excl) } 132 .stab.exclstr 0 : { *(.stab.exclstr) } 133 .stab.index 0 : { *(.stab.index) } 134 .stab.indexstr 0 : { *(.stab.indexstr) } 135 .comment 0 : { *(.comment) } 136 /* DWARF debug sections. 137 Symbols in the DWARF debugging sections are relative to the beginning 138 of the section so we begin them at 0. */ 139 /* DWARF 1 */ 140 .debug 0 : { *(.debug) } 141 .line 0 : { *(.line) } 142 /* GNU DWARF 1 extensions */ 143 .debug_srcinfo 0 : { *(.debug_srcinfo) } 144 .debug_sfnames 0 : { *(.debug_sfnames) } 145 /* DWARF 1.1 and DWARF 2 */ 146 .debug_aranges 0 : { *(.debug_aranges) } 147 .debug_pubnames 0 : { *(.debug_pubnames) } 148 /* DWARF 2 */ 149 .debug_info 0 : { *(.debug_info) } 150 .debug_abbrev 0 : { *(.debug_abbrev) } 151 .debug_line 0 : { *(.debug_line) } 152 .debug_frame 0 : { *(.debug_frame) } 153 .debug_str 0 : { *(.debug_str) } 154 .debug_loc 0 : { *(.debug_loc) } 155 .debug_macinfo 0 : { *(.debug_macinfo) } 156 /* SGI/MIPS DWARF 2 extensions */ 157 .debug_weaknames 0 : { *(.debug_weaknames) } 158 .debug_funcnames 0 : { *(.debug_funcnames) } 159 .debug_typenames 0 : { *(.debug_typenames) } 160 .debug_varnames 0 : { *(.debug_varnames) } 161 /* These must appear regardless of . */ 162} 163