-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlinker.ld
More file actions
57 lines (50 loc) · 1.17 KB
/
linker.ld
File metadata and controls
57 lines (50 loc) · 1.17 KB
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
/* CCOS Kernel Linker Script */
/* Kernel is loaded at 0x10000 by bootloader */
/*
* IMPORTANT: All sections must be contiguous without gaps for objcopy -O binary
* to work correctly. The bootloader loads the kernel binary to physical 0x10000,
* and the kernel uses identity mapping to access it.
*/
ENTRY(kernel_start)
SECTIONS
{
/* Kernel starts at 0x10000 */
. = 0x10000;
/* Text section - code */
.text : {
*(.text)
*(.text.*)
*(.rodata)
*(.rodata.*)
. = ALIGN(8);
}
/* Initialized data - immediately after .rodata */
.data : {
*(.data)
*(.data.*)
. = ALIGN(8);
}
/* Uninitialized data - regular BSS */
.bss : {
__bss_start = .;
*(.bss)
*(.bss.*)
*(COMMON)
. = ALIGN(8);
__bss_end = .;
}
/* Large BSS - for large uninitialized data (e.g., page frame bitmap) */
.lbss : {
__lbss_start = .;
*(.lbss)
*(.lbss.*)
. = ALIGN(8);
__lbss_end = .;
}
/* Discard sections we don't need */
/DISCARD/ : {
*(.comment)
*(.eh_frame)
*(.note.gnu.build-id)
}
}