mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 01:41:59 -05:00
c9747a3236
Multiboot only supports ELF32 executables. This changes the build process to build an ELF32 executable which has a 32-bit entry point, but consists of mostly 64-bit code.
11 lines
283 B
Bash
11 lines
283 B
Bash
#!/bin/sh
|
|
tmp=$(mktemp)
|
|
if [ -f Kernel32 ]; then
|
|
kernel_binary=Kernel32
|
|
else
|
|
kernel_binary=Kernel64
|
|
fi
|
|
nm -n $kernel_binary | awk '{ if ($2 != "a") print; }' | uniq > "$tmp"
|
|
printf "%08x\n" "$(wc -l "$tmp" | cut -f1 -d' ')" > kernel.map
|
|
cat "$tmp" >> kernel.map
|
|
rm -f "$tmp"
|