-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmemory.ld
106 lines (85 loc) · 1.97 KB
/
memory.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
OUTPUT_ARCH("aarch64")
ENTRY(_start)
SECTIONS {
. = 0x80000000;
PROVIDE(vmm_start = .);
__text_start = .;
__idmap_start = .;
.text.head : {
KEEP(*(.text.head))
}
.text.boot : {
KEEP(*(.text.boot))
}
. = ALIGN(4096);
__idmap_end = .;
.text : {
*(.text) *(.text.*)
}
__text_end = .;
. = ALIGN(4096);
__rodata_start = .;
.rodata.device : {
__dt_irqchip_device = .;
KEEP(*(__dt_irqchip_device));
KEEP(*(__dt_irqchip_sentinel));
__dt_serial_device = .;
KEEP(*(__dt_serial_device));
KEEP(*(__dt_serial_sentinel));
__dt_peri_device = .;
KEEP(*(__dt_peri_device));
KEEP(*(__dt_peri_sentinel));
}
.rodata : {
*(.rodata)
. = ALIGN(16);
__msg_size_data_start = .;
*(.rodata.msg)
__msg_size_data_end = .;
. = ALIGN(16);
__msg_handler_data_start = .;
*(.rodata.msg.common)
*(.rodata.msg.node0)
*(.rodata.msg.subnode)
__msg_handler_data_end = .;
*(.rodata.*)
}
__rodata_end = .;
. = ALIGN(16);
.data : {
*(.data) *(.data.*)
}
. = ALIGN(4096);
.boot_pagetable : {
__boot_pagetable_start = .;
__boot_pgt_l1 = .;
. += 4096;
__idmap_pgt_l2_1 = .;
. += 4096;
__idmap_pgt_l2_2 = .;
. += 4096;
__idmap_pgt_l3_1 = .;
. += 4096;
__idmap_pgt_l3_2 = .;
. += 4096;
__boot_pgt_l2 = .;
. += 4096;
__boot_pgt_l3 = .;
. += 4096 * (((vmm_end - vmm_start + 0x200000-1) & ~(0x200000-1)) >> 21);
__boot_pagetable_end = .;
}
. = ALIGN(4096);
.bss : {
__bss_start = .;
*(.bss .bss.*)
__bss_end = .;
}
. = ALIGN(4096);
PROVIDE(vmm_end = .);
/DISCARD/ : {
*(.comment)
}
}
__bss_size = (__bss_end - __bss_start) >> 3;
ASSERT(vmm_start % 0x1000 == 0, "vmm misaligned")
ASSERT(__idmap_end - __idmap_start == 4096, "idmap too big")