-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkernel.lds.S
More file actions
82 lines (68 loc) · 1.7 KB
/
Copy pathkernel.lds.S
File metadata and controls
82 lines (68 loc) · 1.7 KB
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
79
80
81
82
/* SPDX-License-Identifier: MIT */
ENTRY(_start)
OUTPUT_FORMAT(elf64-x86-64)
KERNEL_OFFSET = 0xffffffff80000000;
KERNEL_START = 0x100000;
SECTIONS {
. = KERNEL_START + KERNEL_OFFSET;
/* Text */
.text : AT(ADDR(.text) - KERNEL_OFFSET) {
__code_start = .;
*(.multiboot)
KEEP(*(.text.boot))
*(.text .text.*)
__code_end = .;
}
/* Read-only Data */
. = ALIGN(4096);
.rodata : AT(ADDR(.rodata) - KERNEL_OFFSET) {
__rodata_start = .;
*(.rodata .rodata.*)
__rodata_end = .;
}
/* Data */
. = ALIGN(4096);
.data : AT(ADDR(.data) - KERNEL_OFFSET) {
__data_start = .;
__data_end = .;
*(.data .data.*)
}
/*
* Init code and data section.
* This section will be freed once we are done with kernel
* initialization.
*/
. = ALIGN(4096);
.init.start : AT(ADDR(.init.start) - KERNEL_OFFSET) {
__init_start = .;
}
. = ALIGN(4096);
.init.text : AT(ADDR(.init.text) - KERNEL_OFFSET) {
*(.init.text .init.text.*)
}
.init.data : AT(ADDR(.init.data) - KERNEL_OFFSET) {
*(.init.data .init.data.*)
/* All iniitialization function pointers go here */
__init_hooks_start = .;
*(.init.hook)
__init_hooks_end = .;
}
. = ALIGN(4096);
.init.end : AT(ADDR(.init.end) - KERNEL_OFFSET) {
__init_end = .;
}
/* BSS */
. = ALIGN(4096);
.bss : AT(ADDR(.bss) - KERNEL_OFFSET) {
__bss_start = .;
*(.bss.stack)
*(.bss.ptables)
*(.bss .bss.*)
*(COMMON)
__bss_end = .;
}
__end = .;
/DISCARD/ : {
*(.comment .eh_frame)
}
}