1/* SPDX-License-Identifier: GPL-2.0+ OR BSD-2-Clause */ 2 3OUTPUT_FORMAT("elf64-littleriscv", "elf64-littleriscv", "elf64-littleriscv") 4OUTPUT_ARCH(riscv) 5ENTRY(_start) 6SECTIONS { 7.text 0x0 : 8 { 9 _text = .; 10 *(.text.head) 11 *(.text) 12 *(.text.*) 13 *(.gnu.linkonce.t.*) 14 *(.srodata) 15 *(.rodata*) 16 . = ALIGN(16); 17 } 18 _etext = .; 19 _text_size = . - _text; 20. = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE)); 21.dynamic : 22 { *(.dynamic) } 23.data : 24 ALIGN(4096) 25 { 26 _data = .; 27 *(.sdata) 28 *(.data) 29 *(.data1) 30 *(.data.*) 31 *(.got.plt) 32 *(.got) 33 34 /* the EFI loader doesn't seem to like a .bss section, so we stick 35 it all into .data: */ 36 . = ALIGN(16); 37 _bss = .; 38 *(.sbss) 39 *(.scommon) 40 *(.dynbss) 41 *(.bss*) 42 *(COMMON) 43 . = ALIGN(16); 44 _bss_end = .; 45 } 46 47.rela : 48 { 49 *(.rela.text*) 50 *(.rela.data*) 51 *(.rela.got) 52 *(.rela.dyn) 53 *(.rela.stab) 54 } 55. = ALIGN(4096); 56.rela.plt : { *(.rela.plt) } 57 . = ALIGN(512); 58 _edata = .; 59 _data_size = . - _data; 60 61 . = ALIGN(4096); 62.dynsym : 63 { *(.dynsym) } 64 . = ALIGN(4096); 65.dynstr : 66 { *(.dynstr) } 67 . = ALIGN(4096); 68.note.gnu.build-id : 69 { *(.note.gnu.build-id) } 70. = DATA_SEGMENT_END (.); 71/DISCARD/ : 72 { 73 *(.rel.reloc) 74 *(.eh_frame) 75 *(.note.GNU-stack) 76 } 77.comment 0 : 78 { *(.comment) } 79} 80