-
Notifications
You must be signed in to change notification settings - Fork 0
/
linker.ld
78 lines (61 loc) · 1.17 KB
/
linker.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
ENTRY (_start)
kernel_VMA = 0xffffffff80000000;
kernel_LMA = 0x00100000;
SECTIONS
{
. = kernel_LMA;
kernel_start = .;
.text_boot :
{
boot.o (.text)
}
. = ALIGN(0x1000);
. += kernel_VMA;
.text : AT(ADDR(.text) - kernel_VMA)
{
*(.text)
*(.gnu.linkonce.t*)
}
. = ALIGN(0x1000);
.rodata : AT(ADDR(.rodata) - kernel_VMA)
{
start_ctors = .;
*(.ctor*)
end_ctors = .;
start_dtors = .;
*(.dtor*)
end_dtors = .;
*(.rodata*)
*(.gnu.linkonce.r*)
}
. = ALIGN(0x1000);
.data : AT(ADDR(.data) - kernel_VMA)
{
*(.data)
*(.gnu.linkonce.d*)
edata = .;
}
. = ALIGN(0x1000);
.bss : AT(ADDR(.bss) - kernel_VMA)
{
sbss = .;
*(COMMON)
*(.bss)
*(.gnu.linkonce.b*)
ebss = .;
}
. = ALIGN(0x1000);
.bootstack : AT(ADDR(.bootstack) - kernel_VMA)
{
bootstack_start = .;
. += 0x8000;
bootstack_end = .;
}
. = ALIGN(0x1000);
kernel_end = . - kernel_VMA;
/DISCARD/ :
{
*(.comment)
*(.eh_frame)
}
}