forked from LemonOSProject/LemonOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinkscript-x86.ld
executable file
·66 lines (50 loc) · 954 Bytes
/
linkscript-x86.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
61
62
63
64
65
66
ENTRY(entry)
OUTPUT_FORMAT(elf32-i386)
KERNEL_VIRTUAL_BASE = 0xC0000000;
SECTIONS {
. = 100000;
.multiboot.hdr : {
*(.multiboot.hdr)
}
.multiboot.data : {
*(.multiboot.data)
}
.multiboot.text : {
*(.multiboot.text)
}
. += KERNEL_VIRTUAL_BASE;
.text ALIGN(4096) : AT(ADDR(.text) - KERNEL_VIRTUAL_BASE) {
*(.text)
}
.data ALIGN (4096) : AT(ADDR(.data) - KERNEL_VIRTUAL_BASE) {
*(.data)
*(.rodata*)
}
.bss ALIGN (4096) : AT(ADDR(.bss) - KERNEL_VIRTUAL_BASE) {
_sbss = .;
*(COMMON)
*(.bss)
_ebss = .;
}
/DISCARD/ : {
*(.eh_frame);
*(.comment*);
}
kernel_end = .;
}
/*SECTIONS
{
. = 100000;
.multiboot : { *(.multiboot); }
.text : { *(.text); }
.data : {
*(.data) ;
*(.rodata*);
}
.bss : { *(.bss);}
/DISCARD/ : {
*(.eh_frame);
*(.comment*);
}
kernel_end = .;
}*/