summaryrefslogtreecommitdiff
path: root/Kernel/linker.ld
blob: 73ebbbd4de8b196559f28fa39e158683392b116d (plain)
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
ENTRY(start)

SECTIONS
{
    . = 0xc0100000;

    start_of_kernel_image = .;

    .text ALIGN(4K) : AT (ADDR(.text) - 0xc0000000)
    {
        $<TARGET_OBJECTS:boot>
        *(.multiboot)
        start_of_kernel_text = .;
        *(.text)
        *(.text.startup)
        end_of_kernel_text = .;
    }

    .rodata ALIGN(4K) : AT (ADDR(.rodata) - 0xc0000000)
    {
        start_heap_ctors = .;
        *libkernel_heap.a:*(.ctors)
        end_heap_ctors = .;

        start_ctors = .;
        *(.ctors)
        end_ctors = .;

        *(.rodata)
    }

    .data ALIGN(4K) : AT (ADDR(.data) - 0xc0000000)
    {
        start_of_kernel_data = .;
        *(.data)
        end_of_kernel_data = .;
    }

    .bss ALIGN(4K) : AT (ADDR(.bss) - 0xc0000000)
    {
        start_of_kernel_bss = .;
        *(page_tables)
        *(COMMON)
        *(.bss)
        end_of_kernel_bss = .;
    }

    end_of_kernel_image = .;
}