summaryrefslogtreecommitdiff
path: root/Kernel/linker.ld
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-07-14 21:04:18 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-14 23:04:34 +0200
commit72365841320b9677017ba1667d7cf243f0e01b1f (patch)
tree6f3d2b2ba87370f1c1d7452e1a7d81fee09e5d6c /Kernel/linker.ld
parent5a44a0b9f46e6a2f1a5baf3e0f1ccd4733d98519 (diff)
downloadserenity-72365841320b9677017ba1667d7cf243f0e01b1f.zip
Kernel: Make kernel symbols available much earlier in the boot process
This adds a new section .ksyms at the end of the linker map, reserves 5MiB for it (which are after end_of_kernel_image so they get re-used once MemoryManager is initialized) and then embeds the symbol map into the kernel binary with objcopy. This also shrinks the .ksyms section to the real size of the symbol file (around 900KiB at the moment). By doing this we can make the symbol map available much earlier in the boot process, i.e. even before VFS is available.
Diffstat (limited to 'Kernel/linker.ld')
-rw-r--r--Kernel/linker.ld6
1 files changed, 6 insertions, 0 deletions
diff --git a/Kernel/linker.ld b/Kernel/linker.ld
index 0194ad16e4..698082f837 100644
--- a/Kernel/linker.ld
+++ b/Kernel/linker.ld
@@ -9,6 +9,7 @@ PHDRS
text PT_LOAD ;
data PT_LOAD ;
bss PT_LOAD ;
+ ksyms PT_LOAD ;
}
SECTIONS
@@ -93,4 +94,9 @@ SECTIONS
} :bss
end_of_kernel_image = .;
+
+ .ksyms ALIGN(4K) : AT (ADDR(.ksyms) - KERNEL_VIRTUAL_BASE)
+ {
+ *(.kernel_symbols)
+ } :ksyms
}