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 _start_ctors = .; 75 PROVIDE (start_ctors = .); 76 .ctors : 77 { 78 *(.ctors) 79 } 80 _stop_ctors = .; 81 PROVIDE (stop_ctors = .); 82 .dtors : 83 { 84 *(.dtors) 85 } 86 .got : { *(.got.plt) *(.got) } 87 .dynamic : { *(.dynamic) } 88 /* We want the small data sections together, so single-instruction offsets 89 can access them all, and initialized data all before uninitialized, so 90 we can shorten the on-disk segment size. */ 91 . = ALIGN(8); 92 .sdata : 93 { 94 __global_pointer$ = . + 0x800; 95 *(.sdata) 96 } 97 _edata = .; 98 PROVIDE (edata = .); 99 /* Ensure __bss_start is associated with the next section in case orphan 100 sections are placed directly after .sdata, as has been seen to happen with 101 LLD. */ 102 . = ALIGN(8); 103 __bss_start = .; 104 .sbss : { *(.sbss) *(.scommon) } 105 .bss : 106 { 107 *(.dynbss) 108 *(.bss) 109 *(COMMON) 110 } 111 . = ALIGN(8); 112 _end = . ; 113 PROVIDE (end = .); 114 115 /* Debug */ 116 INCLUDE debuginfo.ldscript 117 118 .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) } 119 /DISCARD/ : { *(.note.GNU-stack) } 120} 121