-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkernel8.ld
46 lines (42 loc) · 1.21 KB
/
kernel8.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
/* https://github.com/rlepigre/bare-metal-aarch64/blob/master/step-01/kernel8.ld */
/* Entry point defined in file "boot.S". */
ENTRY(_start)
SECTIONS {
. = 0x0;
/* Our kernel image will be placed at address 0x80000. */
. = 0x80000;
__kernel_stack_start = .;
__start = .;
__text_start = .;
/* It starts with the ".text" segment. */
.text : {
/* The ".text" segment itself starts with the code from "boot.S". */
/* The "_start" symbol (at the beginning of "boot.S") is at 0x80000. */
*(.text.boot)
*(.text.__start_kernel) /* Provided by main.rs */
*(.text*) /* Everything else? */
}
__text_end = .;
/* Read-only data segment (for initialised const C global variables). */
.rodata : ALIGN(8) {
__rodata_start = .;
*(.rodata*)
__rodata_end = .;
}
/* Data segment (for initialised, non-const C global variables). */
.data : {
__data_start = .;
*(.data*)
__data_end = .;
}
/* BSS segment (for uninitialised C global variables). */
/* BSS stands for "block starting symbol". */
/* The BSS segment must be zeroed prior to entering C code. */
.bss (NOLOAD) : ALIGN(16) {
__bss_start = .;
*(.bss);
. = ALIGN(16);
__bss_end = .;
}
__end = .;
}