-
Notifications
You must be signed in to change notification settings - Fork 0
/
linker_kernel.ld
51 lines (51 loc) · 1.01 KB
/
linker_kernel.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
ENTRY(boot)
OUTPUT_FORMAT("elf64-x86-64")
SECTIONS {
.boot : {
_BOOT_START_ = .;
*(.boot)
*(.gdt)
_BOOT_END_ = .;
}
kernel_text : ALIGN(4K)
{
_KERNEL_TEXT_START_ = .;
*(.init)
*(.fini)
*(.ctors)
*(.dtors)
*crt*.o(.text*)
build/kernel/*(.text*)
_KERNEL_TEXT_END_ = .;
}
kernel_rodata : ALIGN(4K)
{
_KERNEL_RODATA_START_ = .;
build/kernel/*(.rodata*)
*crt*.o(.rodata*)
*(.tm_clone_table)
*(.eh_frame)
_KERNEL_RODATA_END_ = .;
}
kernel_data : ALIGN(4K)
{
_KERNEL_DATA_START_ = .;
build/boot/*(.data)
build/kernel/*(.data)
*crt*.o(.data)
_KERNEL_DATA_END_ = .;
}
kernel_bss : ALIGN(4K)
{
_KERNEL_BSS_START_ = .;
build/boot/*(.bss)
*crt*.o(.bss)
build/kernel/*(.bss)
_KERNEL_BSS_END_ = .;
}
/DISCARD/ :
{
*(.comment*)
*(.note*)
}
}