xref: /DragonStub/gnuefi/elf_riscv64_efi.lds (revision c2102ae05917d81ffc7b854003415e575fc90764)
1/* SPDX-License-Identifier: GPL-2.0+ */
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.text :
48	{ *(.rela.text) *(.rela.text*) }
49.rela.dyn :
50	{ *(.rela.dyn) }
51.rela.plt :
52	{ *(.rela.plt) }
53.rela.got :
54	{ *(.rela.got) }
55.rela.data :
56	{ *(.rela.data) *(.rela.data*) }
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/DISCARD/ :
71	{
72		*(.rel.reloc)
73		*(.eh_frame)
74		*(.note.GNU-stack)
75	}
76.comment 0 :
77	{ *(.comment) }
78}
79