ladybird/Kernel/mkmap.sh
Daniel Bertalan 7608af13cd Kernel: Use the toolchain's nm in mkmap.sh
By using the binary from our build of binutils, we can be sure that `nm`
supports demangling symbols, so we can avoid spawning a separate
`c++filt` process.
2021-12-30 18:10:51 +01:00

7 lines
238 B
Bash

#!/bin/sh
tmp=$(mktemp)
NM="${NM:-nm}"
"$NM" -C -n Kernel | grep -vE \\.Lubsan_data | awk '{ if ($2 != "a") print; }' | uniq > "$tmp"
printf "%08x\n" "$(wc -l "$tmp" | awk '{print $1}')" > kernel.map
cat "$tmp" >> kernel.map
rm -f "$tmp"