summaryrefslogtreecommitdiff
path: root/kernel/ldscript
blob: 2f1e1f474a374c49b06999d41c0fd6f8c420a1e9 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
ENTRY(_launch)

PHDRS
{
    text        PT_LOAD;
    rodata      PT_LOAD;
    data        PT_LOAD;
    eh_frame    PT_LOAD;
    dynamic     PT_LOAD;
}

SECTIONS
{
    /* Load in upper, you know the drill */
    . = 0xFFFFFFFF80000000;

    _kernel_start = .;

    .text : {
        *(.text .text.*)
    } :text

    . += CONSTANT(MAXPAGESIZE);

    .rodata : {
        *(.rodata, .rodata.*)
        *(.srodata, .srodata.*)
    } :rodata

    .init_array : {
        _ctors_start = .;
        KEEP(*(SORT(.init_array.*)))
        KEEP(*(.init_array))
        _ctors_end = .;        
    } :rodata

    .fini_array : {
        _dtors_start = .;
        KEEP(*(SORT(.fini_array)))
        KEEP(*(.fini_array))
        _dtors_end = .;
    } :rodata

    . += CONSTANT(MAXPAGESIZE);

    .data : {
        *(.data .data.*)
        *(.sdata .sdata.*)

        KEEP(*(.requests_start))
        KEEP(*(.requests))
        KEEP(*(.requests_end))
    } :data

    .dynamic : {
        *(.dynamic)
    } :data :dynamic

    .bss : {
        *(.bss .bss.*)
        *(.sbss .sbss.*)
        *(COMMON)
    } :data

    /DISCARD/ : {
        *(.eh_frame*)
        *(.note .note.*)
    }
}