aboutsummaryrefslogtreecommitdiff
path: root/sys/arch/amd64/conf/link.ld
blob: 9c47a8164c0c2a305a2741cb6cc51d01759ba8ea (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
OUTPUT_FORMAT(elf64-x86-64)
OUTPUT_ARCH(i386:x86-64)
ENTRY(main)

PHDRS
{
    text          PT_LOAD    FLAGS((1 << 0) | (1 << 2)) ; /* Execute + Read */
    rodata        PT_LOAD    FLAGS((1 << 2)) ;            /* Read only */
    data          PT_LOAD    FLAGS((1 << 1) | (1 << 2)) ; /* Write + Read */
}

SECTIONS
{
    . = 0xFFFFFFFF80000000;

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

    . += CONSTANT(MAXPAGESIZE);

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

    .drivers : {
        __drivers_init_start = .;
        *(.drivers .drivers)
        __drivers_init_end = .;
    } :rodata

    . += CONSTANT(MAXPAGESIZE);

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

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

    /* -- Cache line alignment -- */
    . = ALIGN(64);
    .data.cacheline_aligned : {
        *(.data.cacheline_aligned)
    }

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