-
Notifications
You must be signed in to change notification settings - Fork 1
/
linker.ld
63 lines (46 loc) · 849 Bytes
/
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
57
58
59
60
OUTPUT_ARCH(i386:x86-64)
ENTRY(_start)
/* start of kernel :). Beware: this is physical address but eok is not! */
sok = 0x100000;
SECTIONS
{
. = sok;
.mboot : AT(ADDR(.mboot))
{
mboot = .;
boot/boot*.o(.mboot)
boot/boot*.o(.text)
boot/boot*.o(.data)
boot/boot*.o(.bss)
}
. += page_offset;
. = ALIGN(4096);
.text : AT(ADDR(.text) - page_offset)
{
text = .;
*(.text)
*(.rodata*)
. = ALIGN(4096);
}
.data : AT(ADDR(.data) - page_offset)
{
data = .;
*(.data)
. = ALIGN(4096);
}
.ehframe : AT(ADDR(.ehframe) - page_offset)
{
ehframe = .;
*(.ehframe)
. = ALIGN(4096);
}
.bss : AT(ADDR(.bss) - page_offset)
{
bss = .;
*(.bss)
*(COMMON)
}
/* end of kernel :) */
eok = .;
/*. = ASSERT(eok <= 0x400000, "linker.ld: Kernel too big!!!");*/
}