forked from pxk27/riscv-hyp-tests
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlinker.ld
63 lines (48 loc) · 953 Bytes
/
linker.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
56
57
58
59
60
61
62
63
#include <platform.h>
OUTPUT_FORMAT(elf64-littleriscv)
ENTRY(_boot)
STACK_SIZE = 1M;
MEMORY {
RAM (rwx) : ORIGIN = MEM_BASE, LENGTH = MEM_SIZE
}
SECTIONS {
.boot : {
*(.boot)
}
.text : {
*(.text)
}
.rodata : {
*(.rodata)
}
.hyp_test_table : {
_hyp_test_table = .;
*(.hyp_test_table)
_hyp_test_table_end = .;
}
_hyp_test_table_size = (_hyp_test_table_end - _hyp_test_table) / 8;
.non_hyp_test_table : {
_non_hyp_test_table = .;
*(.non_hyp_test_table)
_non_hyp_test_table_end = .;
}
_non_hyp_test_table_size = (_non_hyp_test_table_end - _non_hyp_test_table) / 8;
.data : {
*(.data)
}
// HTIF memory needs to be located on its own page
.tohost ALIGN(0x1000) : {
*(.tohost)
}
.bss ALIGN(0x1000) (NOLOAD) : {
__bss_start = .;
*(.bss)
*(.sbss)
*(COMMON)
__bss_end = .;
}
. = MEM_BASE + 0x1ff000;
. = ALIGN(16) + STACK_SIZE;
__stack_top = .;
_end = .;
}