mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-22 18:46:18 +00:00
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:
parent
84b981ade7
commit
8e5f201e59
|
@ -36,7 +36,6 @@ SECTIONS
|
||||||
end_of_safemem_atomic_text = .;
|
end_of_safemem_atomic_text = .;
|
||||||
|
|
||||||
*(.text*)
|
*(.text*)
|
||||||
end_of_kernel_text = .;
|
|
||||||
} :text
|
} :text
|
||||||
|
|
||||||
.driver_init ALIGN(4K) : AT (ADDR(.driver_init))
|
.driver_init ALIGN(4K) : AT (ADDR(.driver_init))
|
||||||
|
@ -46,6 +45,15 @@ SECTIONS
|
||||||
driver_init_table_end = .;
|
driver_init_table_end = .;
|
||||||
} :text
|
} :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) :
|
.rodata ALIGN(4K) :
|
||||||
{
|
{
|
||||||
start_heap_ctors = .;
|
start_heap_ctors = .;
|
||||||
|
@ -66,6 +74,13 @@ SECTIONS
|
||||||
end_of_kernel_data = .;
|
end_of_kernel_data = .;
|
||||||
} :data
|
} :data
|
||||||
|
|
||||||
|
.ro_after_init ALIGN(4K) :
|
||||||
|
{
|
||||||
|
start_of_ro_after_init = .;
|
||||||
|
*(.ro_after_init);
|
||||||
|
end_of_ro_after_init = .;
|
||||||
|
} :data
|
||||||
|
|
||||||
.ksyms ALIGN(4K) :
|
.ksyms ALIGN(4K) :
|
||||||
{
|
{
|
||||||
start_of_kernel_ksyms = .;
|
start_of_kernel_ksyms = .;
|
||||||
|
@ -88,12 +103,6 @@ SECTIONS
|
||||||
physical memory. 8M is wasteful, so this should be properly calculated.
|
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);
|
. = ALIGN(4K);
|
||||||
page_tables_phys_start = .;
|
page_tables_phys_start = .;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue