1/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright (C) 2017 Andes Technology Corporation
4 * Rick Chen, Andes Technology Corporation <rick@andestech.com>
5 */
6
7OUTPUT_ARCH("riscv")
8ENTRY(_start)
9
10SECTIONS
11{
12	. = ALIGN(4);
13	.text : {
14		arch/riscv/cpu/start.o	(.text)
15	}
16
17	/* This needs to come before *(.text*) */
18	.efi_runtime : {
19		__efi_runtime_start = .;
20		*(.text.efi_runtime*)
21		*(.rodata.efi_runtime*)
22		*(.data.efi_runtime*)
23		__efi_runtime_stop = .;
24	}
25
26	.text_rest : {
27		*(.text*)
28	}
29
30	. = ALIGN(4);
31	.rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
32
33	. = ALIGN(4);
34	.data : {
35		*(.data*)
36	}
37	. = ALIGN(4);
38
39	.got : {
40		__got_start = .;
41		*(.got.plt) *(.got)
42		__got_end = .;
43	}
44
45	. = ALIGN(4);
46
47	.u_boot_list : {
48		KEEP(*(SORT(.u_boot_list*)));
49	}
50
51	. = ALIGN(4);
52
53	.efi_runtime_rel : {
54		__efi_runtime_rel_start = .;
55		*(.rel*.efi_runtime)
56		*(.rel*.efi_runtime.*)
57		__efi_runtime_rel_stop = .;
58	}
59
60	. = ALIGN(4);
61
62	/DISCARD/ : { *(.rela.plt*) }
63	.rela.dyn : {
64		__rel_dyn_start = .;
65		*(.rela*)
66		__rel_dyn_end = .;
67	}
68
69	. = ALIGN(4);
70
71	.dynsym : {
72		__dyn_sym_start = .;
73		*(.dynsym)
74		__dyn_sym_end = .;
75	}
76
77	. = ALIGN(4);
78
79	_end = .;
80
81	.bss : {
82		__bss_start = .;
83		*(.bss*)
84		. = ALIGN(8);
85		__bss_end = .;
86	}
87}
88