-
Notifications
You must be signed in to change notification settings - Fork 0
/
link.ld
45 lines (29 loc) · 873 Bytes
/
link.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
ENTRY(kernel_main)
SECTIONS {
. = 0xc0009000;
KERNEL_VIRTUAL_ADDRESS = .;
KERNEL_VIRTUAL_MAPPED_BASE = 0xc0000000;
KERNEL_PHYSICAL_ADDRESS = KERNEL_VIRTUAL_ADDRESS - KERNEL_VIRTUAL_MAPPED_BASE;
.text : AT(ADDR(.text) - KERNEL_VIRTUAL_MAPPED_BASE) {
code = .;
* (.text)
. = ALIGN(0x1000);
}
.rodata : AT(ADDR(.rodata) - KERNEL_VIRTUAL_MAPPED_BASE) {
rodata = .;
* (.rodata)
. = ALIGN(0x1000);
}
.data : AT(ADDR(.data) - KERNEL_VIRTUAL_MAPPED_BASE) {
data = .;
* (.data)
. = ALIGN(0x1000);
}
.bss : AT(ADDR(.bss) - KERNEL_VIRTUAL_MAPPED_BASE) {
bss = .;
* (.bss)
. = ALIGN(0x1000);
}
KERNEL_END_VIRTUAL_ADDRESS = .;
KERNEL_END_PHYSICAL_ADDRESS = KERNEL_END_VIRTUAL_ADDRESS - KERNEL_VIRTUAL_MAPPED_BASE;
}