-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathloader-riscv64-qemu.ld
55 lines (47 loc) · 1.15 KB
/
loader-riscv64-qemu.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
OUTPUT_ARCH(riscv)
ENTRY(_start)
LOADER_OFFSET = 0x80200000;
SECTIONS {
. = LOADER_OFFSET;
. = ALIGN(4096);
.text : {
__text_start = .;
*(.text.start)
*(.text .text.*)
. = ALIGN(4096); # 4KB page alignment for mapping
__text_end = .;
}
.rodata : {
. = ALIGN(4096); # 4KB page alignment for mapping
__rodata_start = .;
*(.got .got.*)
*(.rodata .rodata.*)
*(.srodata .srodata.*)
. = ALIGN(4096); # 4KB page alignment for mapping
__rodata_end = .;
}
.bss (NOLOAD) : {
. = ALIGN(8); # 8-byte alignment for u64 ptr trick
__bss_start = .;
*(.bss .bss.*)
*(.sbss .sbss.*)
__bss_end = .;
}
.data : {
__data_start = .;
PROVIDE(__global_pointer$ = . + 0x800);
*(.data .data.*)
*(.sdata .sdata.*)
. = ALIGN(4096); # 4KB page alignment for mapping
__data_end = .;
}
. = ALIGN(4096);
__stack_start = .;
/DISCARD/ : {
*(.comment*)
*(.gcc_except_table*)
*(.note*)
*(.eh_frame*)
*(.rel.eh_frame*)
}
}