kernel/kernel.ld

45 lines
758 B
Plaintext

OUTPUT_FORMAT(elf64-x86-64)
ENTRY(_start)
PHDRS
{
text PT_LOAD FLAGS((1 << 0) | (1 << 2)); /* READ ----- EXEC */
rodata PT_LOAD FLAGS((1 << 2)); /* READ ----- ---- */
data PT_LOAD FLAGS((1 << 1) | (1 << 2)); /* READ WRITE ---- */
}
SECTIONS
{
. = 0xFFFFFFFF80000000;
_kernel_start = .;
.text : ALIGN(0x1000)
{
*(.text .text.*)
} :text
.rodata : ALIGN(0x1000)
{
*(.rodata .rodata.*)
} :rodata
.data : ALIGN(0x1000)
{
*(.data .data.*)
} :data
.bss : ALIGN(0x1000)
{
*(COMMON)
*(.bss .bss.*)
} :data
/DISCARD/ :
{
*(.eh_frame)
*(.note .note.*)
}
_kernel_end = .;
}