serenity/Kernel/linker.ld
Andreas Kling 8e7420ddf2 Kernel: Harden memory mapping of the kernel image
We now map the kernel's text and rodata segments read+execute.
We also make the data and bss segments non-executable.

Thanks to q3k for the idea! :^)
2020-01-06 13:55:39 +01:00

42 lines
573 B
Plaintext

ENTRY(start)
SECTIONS
{
. = 0x100000;
.text BLOCK(4K) : ALIGN(4K)
{
Arch/i386/Boot/boot.ao
*(.multiboot)
*(.page_tables)
start_of_kernel_text = .;
*(.text)
*(.text.startup)
end_of_kernel_text = .;
}
.rodata BLOCK(4K) : ALIGN(4K)
{
start_ctors = .;
*(.ctors)
end_ctors = .;
*(.rodata)
}
.data BLOCK(4K) : ALIGN(4K)
{
start_of_kernel_data = .;
*(.data)
end_of_kernel_data = .;
}
.bss BLOCK(4K) : ALIGN(4K)
{
start_of_kernel_bss = .;
*(COMMON)
*(.bss)
end_of_kernel_bss = .;
}
}