garage44.eu/jeroen/pinnacle

logclone: git clone https://garage44.eu/jeroen/pinnacle.git

.. /kernel/link/common.ld

raw

/* The kernel's layout. It runs in the top of the address space, at
 * KERNEL_OFFSET plus its physical address (the board's LOAD_ADDRESS). It is
 * entered with the MMU off: as an ELF at the physical address of `_start`,
 * or as a boot image (the same bytes from LOAD_ADDRESS, header first) at
 * wherever a loader put it; boot moves it to LOAD_ADDRESS if need be. */
KERNEL_OFFSET = 0xffffff8000000000;
ENTRY(_start_physical)

SECTIONS
{
    . = KERNEL_OFFSET + LOAD_ADDRESS;
    __kernel_start = .;
    .text : AT(ADDR(.text) - KERNEL_OFFSET) {
        KEEP(*(.text.head))
        KEEP(*(.text.boot))
        *(.text .text.*)
    }
    .rodata : ALIGN(8) { *(.rodata .rodata.*) }
    .data : ALIGN(4096) { *(.data .data.*) }
    __image_file_end = .;
    .bss (NOLOAD) : ALIGN(16) {
        __bss_start = .;
        *(.bss .bss.*)
        *(COMMON)
        . = ALIGN(16);
        __bss_end = .;
    }
    . = ALIGN(16);
    . += 64K;
    __stack_top = .;
    __kernel_end = .;

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

_start_physical = _start - KERNEL_OFFSET;
/* For the Image header and boot's move: absolute numbers, not addresses. */
__load_physical = LOAD_ADDRESS;
__image_file_size = __image_file_end - __kernel_start;
__image_size = __kernel_end - __kernel_start;
__text_offset = LOAD_ADDRESS & 0x1fffff;