aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv64/conf/kernel-link.S
blob: e395e4a1482439c05866749c44b3312e018b86ee (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* SPDX-License-Identifier: copyleft-next-0.3.1 */
/* Copyright 2021 - 2022, Kim Kuparinen < kimi.h.kuparinen@gmail.com > */

OUTPUT_ARCH(riscv)
ENTRY(main)

SECTIONS {
	. = ABSOLUTE(VM_KERNEL);
	__kernel_start = .;
	.text ALIGN(4K) : AT(0) {
		*(.kernel.start);
		*(.text*);
	}

	/* place bss in between different load sections to force objcopy to
	 * output zeroes for it */
	.bss : {
		*(.sbss*)
		*(.bss*)
		*(COMMON)
	}

	.rodata : {
		*(.rodata*)
	}

	.data : {
		*(.data*)
		*(.sdata*)
	}

	__kernel_end = .;

	.garbage : {
		*(.note*)
		*(.riscv.attributes)
	}
}