-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathrvm.ld
More file actions
68 lines (57 loc) · 1.54 KB
/
Copy pathrvm.ld
File metadata and controls
68 lines (57 loc) · 1.54 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
/*
* RVM linker script for QEMU virt AArch64.
*
* QEMU -M virt loads the kernel at 0x4000_0000 (the start of RAM).
* The layout places the boot entry point first (.text.boot), followed
* by general code, read-only data, writable data, and BSS.
*
* Symbols exported:
* _start - entry point (in .text.boot)
* __bss_start - start of BSS section
* __bss_end - end of BSS section
* __stack_top - initial stack pointer (64KB stack)
* __page_tables - start of page table region (4KB aligned)
*/
ENTRY(_start)
MEMORY {
RAM (rwx) : ORIGIN = 0x40000000, LENGTH = 128M
}
SECTIONS {
/* Boot entry point must be at the load address. */
.text.boot 0x40000000 : {
KEEP(*(.text.boot))
} > RAM
.text : ALIGN(4) {
*(.text .text.*)
} > RAM
.rodata : ALIGN(8) {
*(.rodata .rodata.*)
} > RAM
.data : ALIGN(8) {
*(.data .data.*)
} > RAM
.bss (NOLOAD) : ALIGN(16) {
__bss_start = .;
*(.bss .bss.*)
*(COMMON)
__bss_end = .;
} > RAM
/* 64KB hypervisor stack, growing downward. */
. = ALIGN(4096);
__stack_bottom = .;
. = . + 0x10000;
__stack_top = .;
/* Page table region: 4KB-aligned, room for L1 + 4 L2 tables. */
. = ALIGN(4096);
__page_tables = .;
. = . + (5 * 4096);
/* Heap region (optional, for future use). */
. = ALIGN(4096);
__heap_start = .;
/* Discard debug sections for release builds. */
/DISCARD/ : {
*(.comment)
*(.note.*)
*(.eh_frame*)
}
}