forked from mit-pdos/xv6-riscv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkernel.ld
46 lines (39 loc) · 1004 Bytes
/
kernel.ld
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
39
40
41
42
43
44
45
46
OUTPUT_ARCH( "riscv" )
ENTRY( _entry )
BASE_ADDRESS = 0x80100000;
SECTIONS
{
/*
* ensure that entry.S / _entry is at BASE_ADDRESS,
* where bootloader (or qemu's -kernel) jumps.
*/
. = BASE_ADDRESS;
.text : {
*(.text .text.*)
. = ALIGN(4K); /* align trampsec to page boundary (4K bytes) */
_trampoline = .;
*(trampsec)
. = ALIGN(4K);
ASSERT(. - _trampoline == 4K, "error: trampoline larger than one page");
PROVIDE(etext = .);
}
.rodata : {
. = ALIGN(4K); /* align regions to page boundary */
*(.srodata .srodata.*) /* do not need to distinguish this from .rodata */
. = ALIGN(4K);
*(.rodata .rodata.*)
}
.data : {
. = ALIGN(4K);
*(.sdata .sdata.*) /* do not need to distinguish this from .data */
. = ALIGN(4K);
*(.data .data.*)
}
.bss : {
. = ALIGN(4K);
*(.sbss .sbss.*) /* do not need to distinguish this from .bss */
. = ALIGN(4K);
*(.bss .bss.*)
}
PROVIDE(kernel_end = .);
}