forked from asweeney86/tinyboot
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlinker.ld
41 lines (32 loc) · 802 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
OUTPUT_FORMAT(elf32-i386)
ENTRY(loader)
KERNEL_BOOT_VMA = 0x00100000;
KERNEL_HIGH_VMA = 0xC0000000;
SECTIONS{
. = KERNEL_BOOT_VMA;
.boot :{
*/boot.o (.text)
}
. += KERNEL_HIGH_VMA;
_core_start = .;
.text ALIGN(0x1000) : AT(ADDR(.text) - KERNEL_HIGH_VMA) {
_core_code = .;
*(EXCLUDE_FILE (*/boot.o) .text)
/* all readonly data is merged with this section, too */
*(.rodata*)
}
.data ALIGN (0x1000) : AT(ADDR(.data) - KERNEL_HIGH_VMA) {
_core_data = .;
*(.data)
}
.bss ALIGN (0x1000) : AT(ADDR(.bss) - KERNEL_HIGH_VMA) {
_core_bss = .;
*(COMMON)
*(.bss)
. = ALIGN(4096);
_core_ebss = .;
}
/* 4K alignment is guaranteed! */
_core_end = .;
end = .; _end = .; __end = .;
}