/* Tell the linker that we want an aarch64 ELF64 output file */ OUTPUT_FORMAT(elf64-littleaarch64) /* We want the symbol kmain to be our entry point */ ENTRY(kmain) /* Define the program headers we want so the bootloader gives us the right */ /* MMU permissions; this also allows us to exert more control over the linking */ /* process. */ PHDRS { text PT_LOAD; rodata PT_LOAD; data PT_LOAD; } SECTIONS { /* We want to be placed in the topmost 2GiB of the address space, for optimisations */ /* and because that is what the Limine spec mandates. */ /* Any address in this region will do, but often 0xffffffff80000000 is chosen as */ /* that is the beginning of the region. */ . = 0xffffffff80000000; __kernel_start = .; __text_start = .; .text : ALIGN(0x1000) { *(.text.vectors) *(.text .text.*) } :text . = ALIGN(CONSTANT(MAXPAGESIZE)); __text_end = .; __rodata_start = .; .rodata : { *(.rodata .rodata.*) } :rodata . = ALIGN(CONSTANT(MAXPAGESIZE)); __rodata_end = .; __data_start = .; .data : { *(.data .data.*) KEEP(*(.requests_start_marker)) KEEP(*(.requests)) KEEP(*(.requests_end_marker)) } :data .bss : { *(.bss .bss.*) *(COMMON) } :data __data_end = .; __kernel_end = .; /* Discard .note.* and .eh_frame* since they may cause issues on some hosts. */ /DISCARD/ : { *(.eh_frame*) *(.note .note.*) } }