-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathkernel.ld.in
58 lines (55 loc) · 1.16 KB
/
kernel.ld.in
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
47
48
49
50
51
52
53
54
55
56
57
58
/*
* This file specifies locations in the virtual address space where the final
* sections will be located.
*
* On startup, QEMU loads the code at the physical address, 0x4001000. However,
* the exact address should not matter. startup.s is position-independent, and
* maps the code to the addresses specified by the linker symbols defined here.
*/
#include "configvals.h"
ENTRY(_start)
SECTIONS {
. = CONFIG_LINK_ADDR;
code_start = .;
.startup . : {
kernel/startup.o(*)
}
.entry . : {
kernel/entry.o(*)
}
ASSERT(. < code_start + 0x1000, "more than one page of memory for startup + ISR")
nopreempt_begin = .;
.nopreempt . : {
*(.nopreempt)
}
nopreempt_end = .;
.text . : {
*(.text)
}
code_end = .;
/* data on separate page to allow enforcing execute never */
. = ALIGN(0x1000);
data_start = .;
.rodata . : {
*(.rodata)
}
.data . : {
*(.data)
*(.data.rel)
*(.data.rel.local)
}
bss_start = .;
.bss . : {
*(.bss)
}
data_end = .;
/* Kernel mode stack */
. = ALIGN(0x1000);
stack_start = .;
. = . + 0x1000; /* 4kB stack memory */
stack_end = .;
/* Unused memory here */
. = ALIGN(0x4000);
unused_start = .;
dynamic_start = .;
}