mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:54:58 +00:00

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.
5 lines
127 B
Bash
5 lines
127 B
Bash
#!/bin/sh
|
|
tmp=$(mktemp)
|
|
(cat kernel.map; printf '%b' '\0') > "$tmp"
|
|
objcopy --update-section .ksyms="$tmp" Kernel
|
|
rm -f "$tmp"
|