summaryrefslogblamecommitdiffstats
path: root/link/x86_64-jove.ld
blob: 068661732d4f9dc015311240f0266389500a60e2 (plain) (tree)



















































                                                           
OUTPUT_FORMAT(elf64-x86-64)
OUTPUT_ARCH(i386:x86-64)

ENTRY(_start)

PAGESIZE = CONSTANT(MAXPAGESIZE);

PHDRS
{
    text    PT_LOAD FLAGS((1 << 0) | (1 << 2)) ; /* RO EX*/
    rodata  PT_LOAD FLAGS((1 << 2)) ;            /* RO*/
    data    PT_LOAD FLAGS((1 << 1) | (1 << 2)); /* RW*/
    bss     PT_LOAD FLAGS((1 << 1) | (1 << 2)); /* RW*/
}

SECTIONS
{
    . = 0xFFFFFFFF80000000;
    _kernel_start = .;

    .text BLOCK(PAGESIZE) : ALIGN(PAGESIZE) {
        *(.init)
        *(.text .text.*)

        . = ALIGN(8);
        _kernel_ctors_start = .;
        *(.ctors)
        _kernel_ctors_end = .;

        *(.fini)
    } :text

    .rodata BLOCK(PAGESIZE) : ALIGN(PAGESIZE) {
        *(.rodata .rodata.*)
    } :rodata

    .data BLOCK(PAGESIZE) : ALIGN(PAGESIZE) {
        *(.data .data.*)
    } :data

    .bss BLOCK(PAGESIZE) : ALIGN(PAGESIZE) {
        *(COMMON)
        *(.bss .bss.*)
    } :bss

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

    _kernel_end = .;
}