-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlinker.ld
More file actions
38 lines (31 loc) · 862 Bytes
/
linker.ld
File metadata and controls
38 lines (31 loc) · 862 Bytes
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
/* Linker script for k on QEMU virt (AArch64)
* Virt RAM base = 0x4000_0000. We link at 0x4020_0000 to leave headroom.
* Identity-map VA=PA initially, so VMA=LMA is fine.
*/
ENTRY(_start)
SECTIONS {
. = 0x40200000;
/* Code first: put bootstrap early for nice, aligned entry */
.text : ALIGN(16) {
KEEP(*(.text.boot)) /* your _start in head.S should live here */
*(.text*) /* rest of code */
}
.rodata : ALIGN(16) {
*(.rodata*) *(.const*)
}
.data : ALIGN(16) {
*(.data*)
}
/* BSS is NOBITS: occupies memory at runtime, not file size */
.bss (NOLOAD) : ALIGN(16) {
__bss_start = .;
*(.bss*) *(COMMON)
. = ALIGN(16);
__bss_end = .;
}
/* Simple 8 KiB boot stack (grows down). Expose _stack_* to head.S */
. = ALIGN(16);
_stack_bottom = .;
. += 8192;
_stack_top = .;
}