forked from DragonOS-Community/DragonOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlink.ld
More file actions
126 lines (106 loc) · 2.16 KB
/
link.ld
File metadata and controls
126 lines (106 loc) · 2.16 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
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
OUTPUT_FORMAT(
"elf64-littleriscv",
"elf64-littleriscv",
"elf64-littleriscv"
)
OUTPUT_ARCH(riscv)
ENTRY(_start)
SECTIONS
{
KERNEL_VMA = 0xffffffc000000000;
. = 0x1000000;
. += KERNEL_VMA;
. = ALIGN(4096);
boot_text_start_pa = .;
.boot.text : AT(boot_text_start_pa - KERNEL_VMA)
{
KEEP(*(.bootstrap))
*(.bootstrap)
*(.bootstrap.*)
. = ALIGN(4096);
*(.initial_pgtable_section)
. = ALIGN(4096);
}
. = ALIGN(4096);
text_start_pa = .;
__executable_start = .;
.text (text_start_pa): AT(text_start_pa - KERNEL_VMA)
{
_text = .;
/* any files' .text */
*(.text)
/* any files' .text.*, for example: rust .text._ZN* */
*(.text.*)
_etext = .;
__etext = .;
}
. = ALIGN(32768);
data_start_pa = .;
.data (data_start_pa): AT(data_start_pa - KERNEL_VMA)
{
_data = .;
*(.data)
*(.data.*)
*(.got.plt)
*(.got)
_edata = .;
}
. = ALIGN(32768);
rodata_start_pa = .;
.rodata (rodata_start_pa): AT(rodata_start_pa - KERNEL_VMA)
{
_rodata = .;
*(.rodata)
*(.rodata.*)
*(.gcc_except_table .gcc_except_table.*)
_erodata = .;
}
. = ALIGN(32768);
trace_point_start_pa = .;
.tracepoint (trace_point_start_pa): AT(trace_point_start_pa - KERNEL_VMA)
{
_tracepoint = .;
*(.tracepoint)
*(.tracepoint.*)
_etracepoint = .;
}
. = ALIGN(4096);
syscall_table_start_pa = .;
.syscall_table (syscall_table_start_pa): AT(syscall_table_start_pa - KERNEL_VMA)
{
_syscall_table = .;
*(.syscall_table)
*(.syscall_table.*)
_esyscall_table = .;
}
. = ALIGN(32768);
init_proc_union_start_pa = .;
.data.init_proc_union (init_proc_union_start_pa): AT(init_proc_union_start_pa - KERNEL_VMA)
{ *(.data.init_proc_union) }
. = ALIGN(32768);
bss_start_pa = .;
.bss (bss_start_pa): AT(bss_start_pa - KERNEL_VMA)
{
_bss = .;
*(.bss)
*(.bss.*)
*(.sbss)
*(.sbss.*)
_ebss = .;
}
eh_frame = .;
.eh_frame (eh_frame): AT(eh_frame - KERNEL_VMA)
{
__eh_frame_hdr_start = .;
*(.eh_frame_hdr)
__eh_frame_hdr_end = .;
__eh_frame_start = .;
*(.eh_frame)
*(.rela.eh_frame)
__eh_frame_end = .;
}
_end = .;
/DISCARD/ : {
/* *(.eh_frame) */
}
}