mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +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
Notes:
sideshowbarker
2024-07-18 00:54:03 +09:00
Author: https://github.com/spholz Commit: https://github.com/SerenityOS/serenity/commit/8e5f201e59 Pull-request: https://github.com/SerenityOS/serenity/pull/22206
1 changed files with 16 additions and 7 deletions
|
@ -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 = .;
|
||||
|
||||
|
|
Loading…
Reference in a new issue