-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathart_kernel.ld
More file actions
80 lines (68 loc) · 1.91 KB
/
Copy pathart_kernel.ld
File metadata and controls
80 lines (68 loc) · 1.91 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/* The bootloader will look at this image and start execution at the symbol
designated as the entry point. */
ENTRY(_start)
OUTPUT_FORMAT(elf32-i386)
OUTPUT_ARCH(i386:i386)
/* Tell where the various sections of the object files will be put in the final
kernel image. */
SECTIONS
{
. = 0x00100000;
/* The kernel will live at 3GB + 1MB in the virtual address space, */
/* which will be mapped to 1MB in the physical address space. */
/* Note that we page-align the sections. */
.multiboot.data : {
*(.multiboot.data)
}
.multiboot.text : AT(ADDR(.multiboot.text))
{
KEEP(*(.multiboot.text))
}
. += 0xC0000000;
/* Add a symbol that indicates the start address of the kernel. */
.text ALIGN (4K) : AT (ADDR (.text) - 0xC0000000)
{
kernel_start = .;
*(.text*)
*(.rodata*)
*(.init)
*(.fini)
*(.eh_frame*)
*(.eh_frame_hdr*)
}
.data ALIGN (4K) : AT (ADDR (.data) - 0xC0000000)
{
*(.data*)
*(.rawdata*)
*(.got*)
*(.ctors)
*(.dtors)
}
.init_array ALIGN(4k) : AT(ADDR(.init_array) - 0xC0000000)
{
start_ctors = .;
KEEP(*(.init_array))
KEEP(*(SORT_BY_INIT_PRIORITY(.init_array.*)))
end_ctors = .;
}
.bss ALIGN (4K) : AT (ADDR (.bss) - 0xC0000000)
{
*(COMMON)
*(.bss)
*(.bootstrap_stack)
}
.trampoline.text ALIGN (4K) : AT (ADDR (.trampoline.text) - 0xC0000000){
kernel_trampoline_text_start = .;
*(.trampoline.text)
kernel_trampoline_text_end = .;
}
.trampoline.data ALIGN(4K) : AT (ADDR (.trampoline.data) - 0xC0000000) {
kernel_trampoline_data_start = .;
*(.trampoline.data)
*(.trampoline.rodata)
kernel_trampoline_data_end = .;
}
/DISCARD/ : { *(.fini_array*) *(.comment) }
/* Add a symbol that indicates the end address of the kernel. */
kernel_end = .;
}