Kernel: Merge split function and data sections into one during linking

Also add an assertion to make sure the safemem sections are never
discarded by the linker.
This commit is contained in:
Owen Smith 2021-02-09 22:49:02 +00:00 committed by Andreas Kling
commit c2de22a635
Notes: sideshowbarker 2024-07-18 22:24:52 +09:00
2 changed files with 14 additions and 6 deletions

View file

@ -11,16 +11,15 @@ SECTIONS
$<TARGET_OBJECTS:boot>
*(.multiboot)
start_of_kernel_text = .;
*(.text)
*(.text.startup)
start_of_safemem_text = .;
*(.text.safemem)
KEEP(*(.text.safemem))
end_of_safemem_text = .;
start_of_safemem_atomic_text = .;
*(.text.safemem.atomic)
KEEP(*(.text.safemem.atomic))
end_of_safemem_atomic_text = .;
*(.text*)
end_of_kernel_text = .;
}
@ -34,13 +33,13 @@ SECTIONS
*(.ctors)
end_ctors = .;
*(.rodata)
*(.rodata*)
}
.data ALIGN(4K) : AT (ADDR(.data) - 0xc0000000)
{
start_of_kernel_data = .;
*(.data)
*(.data*)
end_of_kernel_data = .;
}