-
Notifications
You must be signed in to change notification settings - Fork 17
/
linker.ld
56 lines (47 loc) · 1.2 KB
/
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
ENTRY(_start)
OUTPUT_FORMAT(elf64-x86-64)
phys = 0x100000;
offset = 0xFFFFFFFF80000000;
virt = offset + phys;
SECTIONS
{
. = virt;
.rodata ALIGN(0x1000) : AT(ADDR(.rodata) - offset)
{
_rodata_begin_phys = . - offset;
*(.multiboot_header)
*(.rodata)
*(.rodata*)
*(.eh_frame)
_rodata_end_phys = . - offset;
}
.text ALIGN(0x1000) : AT(ADDR(.text) - offset)
{
_text_begin_phys = . - offset;
*(.text)
*(.text*)
*(.init)
*(.fini)
*(.ctors)
*(.dtors)
_text_end_phys = . - offset;
}
.data ALIGN(0x1000) : AT(ADDR(.data) - offset)
{
_data_begin_phys = . - offset;
*(.data)
_data_end_phys = . - offset;
}
.bss ALIGN(0x1000) : AT(ADDR(.bss) - offset)
{
_bss_begin_phys = . - offset;
*(.bss)
*(COMMON)
_bss_end_phys = . - offset;
}
/DISCARD/ :
{
*(.comment)
}
_kernel_end_phys = . + 0x1000 - offset;
}