Add a tool to auto-generate a symbol map, borrowed from SerenityOS :)

This commit is contained in:
apio 2022-09-19 20:35:24 +02:00
parent d8bfb76eef
commit d79596f21b
3 changed files with 13 additions and 2 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ toolchain/
**/*.o **/*.o
initrd/boot/moon.elf initrd/boot/moon.elf
kernel/bin/moon.elf kernel/bin/moon.elf
initrd/sys/moon.sym

View File

@ -75,3 +75,4 @@ moon-clean:
$(LUNA_ROOT)/initrd/boot/moon.elf: $(MOON_BIN)/moon.elf $(LUNA_ROOT)/initrd/boot/moon.elf: $(MOON_BIN)/moon.elf
@mkdir -p $(@D) @mkdir -p $(@D)
cp $^ $@ cp $^ $@
tools/generate-symbols.sh

9
tools/generate-symbols.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
set -e
source $(dirname $0)/env.sh
cd $LUNA_ROOT
nm -C -n initrd/boot/moon.elf | grep -vE \\.Lubsan_data | awk '{ if ($2 != "a") print; }' | uniq > initrd/sys/moon.sym