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