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		_data = .;
30		*(.sdata)
31		*(.data)
32		*(.data1)
33		*(.data.*)
34		*(.got.plt)
35		*(.got)
36
37		/*
38		 * The EFI loader doesn't seem to like a .bss section, so we
39		 * stick it all into .data:
40		 */
41		. = ALIGN(16);
42		_bss = .;
43		*(.sbss)
44		*(.scommon)
45		*(.dynbss)
46		*(.bss)
47		*(.bss.*)
48		*(COMMON)
49		. = ALIGN(16);
50		_bss_end = .;
51		_edata = .;
52	}
53	.rela.dyn : { *(.rela.dyn) }
54	.rela.plt : { *(.rela.plt) }
55	.rela.got : { *(.rela.got) }
56	.rela.data : { *(.rela.data) *(.rela.data*) }
57	_data_size = . - _etext;
58
59	. = ALIGN(4096);
60	.dynsym   : { *(.dynsym) }
61	. = ALIGN(4096);
62	.dynstr   : { *(.dynstr) }
63	. = ALIGN(4096);
64	.note.gnu.build-id : { *(.note.gnu.build-id) }
65	/DISCARD/ : {
66		*(.rel.reloc)
67		*(.eh_frame)
68		*(.note.GNU-stack)
69	}
70	.comment 0 : { *(.comment) }
71}
72