-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlinker.ld
42 lines (35 loc) · 876 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
OUTPUT_FORMAT("elf32-i386")
ENTRY(start)
phys = 0x100000;
offset = 0xC0000000;
virt = offset + phys;
SECTIONS
{
. = virt; /* the code should be loaded at 1 MB */
kernel_start = .;
.text ALIGN (0x1000) : AT(ADDR(.text) - offset)
{
*(.text)
}
/* align at 4 KB */
/* all text sections from all files */
.rodata ALIGN (0x1000) :AT(ADDR(.rodata) - offset)
/* align at 4 KB */
{
*(.rodata*)
/* all read-only data sections from all files */
}
.data ALIGN (0x1000) :AT(ADDR(.data) - offset)
{
*(.data)
} /* align at 4 KB */
.bss ALIGN (0x1000) : AT(ADDR(.bss) - offset)
{
*(COMMON)
*(.bss)
} /* align at 4 KB */
/* all data sections from all files */
/* all COMMON sections from all files */
/* all bss sections from all files */
kernel_end = .;
}