-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlinker.ld
More file actions
57 lines (45 loc) · 1.05 KB
/
Copy pathlinker.ld
File metadata and controls
57 lines (45 loc) · 1.05 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
ENTRY(_start)
PHDRS
{
text PT_LOAD FLAGS((1 << 2) | (1 << 0)); /* Read | Execute */
rodata PT_LOAD FLAGS((1 << 2)); /* Read Only */
data PT_LOAD FLAGS((1 << 2) | (1 << 1)); /* Read | Write */
}
SECTIONS
{
. = 0xffffffff80000000;
/* 1. Executable Code Segment */
.text : {
*(.text .text.*)
} :text
. = ALIGN(0x1000);
/* 2. Trampoline (Embedded as data in the High-Half) */
.trampoline : {
_binary_trampoline_bin_start = .;
*(.trampoline)
_binary_trampoline_bin_end = .;
} :text
. = ALIGN(0x1000);
/* 3. Read-Only Data */
.rodata : {
*(.rodata .rodata.*)
} :rodata
. = ALIGN(0x1000);
/* 4. Data and BSS */
.limine_requests : {
KEEP(*(.limine_requests_start))
KEEP(*(.limine_requests))
KEEP(*(.limine_requests_end))
} :data
.data : {
*(.data .data.*)
} :data
.bss : {
*(.bss .bss.*)
*(COMMON)
} :data
/DISCARD/ : {
*(.eh_frame)
*(.note .note.*)
}
}