This repository has been archived on 2025-02-26. You can view files and clone it, but cannot push or open issues or pull requests.
hilbert-os/kernel/link.ld
2024-01-08 22:28:41 -05:00

47 lines
646 B
Text

OUTPUT_FORMAT(elf64-x86-64)
OUTPUT_ARCH(i386:x86-64)
ENTRY(entry)
PHDRS {
rx PT_LOAD FLAGS(5);
ro PT_LOAD FLAGS(4);
rw PT_LOAD FLAGS(6);
}
SECTIONS {
/* see also ../documentation/memory.txt */
. = 0xffffffffc0000000;
__kernel_rx_start = .;
.text : {
*(.text .text.*)
} : rx
. = ALIGN(4096);
__kernel_rx_end = .;
__kernel_ro_start = .;
.rodata : {
*(.rodata .rodata.*)
} : ro
. = ALIGN(4096);
__kernel_ro_end = .;
__kernel_rw_start = .;
.data : {
*(.data .data.*)
} : rw
. = ALIGN(4096);
.bss : {
*(.bss .bss.*)
*(COMMON)
} : rw
. = ALIGN(4096);
__kernel_rw_end = .;
}