-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlinker.ld
More file actions
51 lines (42 loc) · 774 Bytes
/
linker.ld
File metadata and controls
51 lines (42 loc) · 774 Bytes
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 point */
ENTRY(_start)
KERNEL_PHYS = 0x100000;
KERNEL_VIRT = 0xffffffff80000000;
SECTIONS
{
. = KERNEL_PHYS;
.boot :
{
KEEP(*(.multiboot))
*(.boot.*)
}
. += KERNEL_VIRT;
.text : AT(ADDR(.text) - KERNEL_VIRT)
{
_code = .;
*(.text.*)
*(.rodata.*)
. = ALIGN(4096);
}
/* initialised rw data */
.data : AT(ADDR(.data) - KERNEL_VIRT)
{
_data = .;
*(.data.*)
. = ALIGN(4096);
}
/* uninitialised rw data and stack */
.bss : AT(ADDR(.bss) - KERNEL_VIRT)
{
_bss = .;
*(.bss.*)
*(COMMON)
_bss_end = .;
. = ALIGN(4096);
}
/DISCARD/ :
{
*(.comment)
}
KERNEL_END = .;
}