Kernel/riscv64: Add .{ro,unmap}_after_init sections to linker script

`MM.protect_kernel_image` would otherwise make the contents of these
sections read-only, as they were for some reason placed before `.data`
and after the start of `.text`.
This commit is contained in:
Sönke Holz 2023-12-08 01:02:04 +01:00 committed by Andrew Kaster
parent 84b981ade7
commit 8e5f201e59
Notes: sideshowbarker 2024-07-18 00:54:03 +09:00

View file

@ -36,7 +36,6 @@ SECTIONS
end_of_safemem_atomic_text = .;
*(.text*)
end_of_kernel_text = .;
} :text
.driver_init ALIGN(4K) : AT (ADDR(.driver_init))
@ -46,6 +45,15 @@ SECTIONS
driver_init_table_end = .;
} :text
.unmap_after_init ALIGN(4K) :
{
start_of_unmap_after_init = .;
*(.unmap_after_init*);
end_of_unmap_after_init = .;
end_of_kernel_text = .;
} :text
.rodata ALIGN(4K) :
{
start_heap_ctors = .;
@ -66,6 +74,13 @@ SECTIONS
end_of_kernel_data = .;
} :data
.ro_after_init ALIGN(4K) :
{
start_of_ro_after_init = .;
*(.ro_after_init);
end_of_ro_after_init = .;
} :data
.ksyms ALIGN(4K) :
{
start_of_kernel_ksyms = .;
@ -88,12 +103,6 @@ SECTIONS
physical memory. 8M is wasteful, so this should be properly calculated.
*/
/* FIXME: Placeholder to satisfy linker */
start_of_unmap_after_init = .;
end_of_unmap_after_init = .;
start_of_ro_after_init = .;
end_of_ro_after_init = .;
. = ALIGN(4K);
page_tables_phys_start = .;