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 _edata = .; 56 } 57 .rela.dyn : { *(.rela.dyn) } 58 .rela.plt : { *(.rela.plt) } 59 .rela.got : { *(.rela.got) } 60 .rela.data : { *(.rela.data) *(.rela.data*) } 61 _data_size = . - _etext; 62 63 . = ALIGN(4096); 64 .dynsym : { *(.dynsym) } 65 . = ALIGN(4096); 66 .dynstr : { *(.dynstr) } 67 . = ALIGN(4096); 68 69 _end = . ; 70 .note.gnu.build-id : { *(.note.gnu.build-id) } 71 /DISCARD/ : { 72 *(.rel.reloc) 73 *(.eh_frame) 74 *(.note.GNU-stack) 75 } 76 .comment 0 : { *(.comment) } 77} 78