From 07b75b0a74a2164d54b508d4d30426bd2830ae86 Mon Sep 17 00:00:00 2001 From: Jiajie Chen Date: Sun, 16 Jun 2019 00:11:25 +0800 Subject: [PATCH] Fix fill_symbols aarch64 on macOS --- kernel/Makefile | 2 +- tools/fill_symbols/aarch64.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/Makefile b/kernel/Makefile index 0ce9b8b9..a1b3e34e 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -304,7 +304,7 @@ $(bootloader): $(kernel) ifeq ($(need_bootloader), true) ifeq ($(arch), aarch64) @echo "Patching symbols into kernel." - ../tools/fill_symbols/aarch64.sh target/aarch64/$(mode)/rcore + @../tools/fill_symbols/aarch64.sh target/aarch64/$(mode)/rcore $(prefix) endif @echo Building $(arch) bootloader @$(strip) $(kernel) -o $(kernel)_stripped diff --git a/tools/fill_symbols/aarch64.sh b/tools/fill_symbols/aarch64.sh index 30f0dcb2..a12c7bdc 100755 --- a/tools/fill_symbols/aarch64.sh +++ b/tools/fill_symbols/aarch64.sh @@ -3,11 +3,11 @@ echo "Filling kernel symbols." rcore=$1 tmpfile=$(mktemp /tmp/rcore-symbols.txt.XXXXXX) echo "Writing symbol table." -aarch64-elf-nm $1 >$tmpfile +$2nm $1 >$tmpfile gzip $tmpfile tmpfile=$tmpfile.gz -symbol_table_loc=$((16#$(aarch64-elf-objdump -D $rcore -j .data -F |grep "" |grep -oEi "0x[0-9a-f]+" |grep -oEi "[0-9a-f][0-9a-f]+"))) -symbol_table_size_loc=$((16#$(aarch64-elf-objdump -D $rcore -j .data -F |grep "" |grep -oEi "0x[0-9a-f]+" |grep -oEi "[0-9a-f][0-9a-f]+"))) +symbol_table_loc=$((16#$($2objdump -D $rcore -j .data -F |grep "" |grep -oEi "0x[0-9a-f]+" |grep -oEi "[0-9a-f][0-9a-f]+"))) +symbol_table_size_loc=$((16#$($2objdump -D $rcore -j .data -F |grep "" |grep -oEi "0x[0-9a-f]+" |grep -oEi "[0-9a-f][0-9a-f]+"))) echo $symbol_table_loc echo $symbol_table_size_loc FILESIZE=$(stat -c%s "$tmpfile")