-
Notifications
You must be signed in to change notification settings - Fork 0
/
linker.ld
50 lines (40 loc) · 915 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
OUTPUT_FORMAT(elf32-i386)
ENTRY(_start)
SECTIONS
{
. = 0xC0000000;
_kernel_virt_start = .;
_kernel_phys_start = _kernel_virt_start - 0xBFF00000;
.text ALIGN (4K) : AT (ADDR (.text) - 0xBFF00000)
{
_TEXT_START = .;
*(.multiboot)
*(.text)
_TEXT_END = .;
}
.rodata ALIGN(4K) : AT (ADDR (.rodata) - 0xBFF00000)
{
_RODATA_START = .;
*(.rodata)
_RODATA_END = .;
}
/* Read-write data (initialized) */
.data ALIGN(4K) : AT (ADDR (.data) - 0xBFF00000)
{
_DATA_START = .;
*(.data)
_DATA_END = .;
}
/* Read-write data (uninitialized) and stack */
.bss ALIGN(4K) : AT (ADDR (.bss) - 0xBFF00000)
{
_BSS_START = .;
*(COMMON)
*(.bss)
_BSS_END = .;
}
_kernel_virt_end = .;
_kernel_phys_end = _kernel_virt_end - 0xBFF00000;
/* The compiler may produce other sections, by default it will put them in
a segment with the same name. Simply add stuff here as needed. */
}