Support AArch64 in bad_build_check (#8188)

* Support AArch64 in bad_build_check

Related: #8164

* UNdo uneeded
This commit is contained in:
jonathanmetzman 2022-08-08 19:40:11 -04:00 committed by GitHub
parent 18bb7080ec
commit ac9a50c7a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 13 deletions

View File

@ -306,22 +306,18 @@ function check_mixed_sanitizers {
return 0
fi
if [[ $ARCHITECTURE == 'i386' ]]
if [[ $ARCHITECTURE == "x86_64" ]]
then
CALL_INSN="callq\s+[0-9a-f]+\s+<"
elif [[ $ARCHITECTURE == "i386" ]]
then
CALL_INSN="call\s+[0-9a-f]+\s+<"
elif [[ $ARCHITECTURE == "aarch64" ]]
then
CALL_INSN="bl\s+[0-9a-f]+\s+<"
else
case $(uname -m) in
x86_64)
CALL_INSN="callq?\s+[0-9a-f]+\s+<"
;;
aarch64)
CALL_INSN="bl\s+[0-9a-f]+\s+<"
;;
*)
echo "Error: unsupported machine hardware $(uname -m)"
exit 1
;;
esac
echo "UNSUPPORTED ARCHITECTURE"
exit 1
fi
local ASAN_CALLS=$(objdump -dC $FUZZER | egrep "${CALL_INSN}__asan" -c)
local DFSAN_CALLS=$(objdump -dC $FUZZER | egrep "${CALL_INSN}__dfsan" -c)
@ -397,6 +393,9 @@ function check_architecture {
elif [[ $ARCHITECTURE == "i386" ]]
then
echo $FILE_OUTPUT | grep "80386" > /dev/null
elif [[ $ARCHITECTURE == "aarch64" ]]
then
echo $FILE_OUTPUT | grep "aarch64" > /dev/null
else
echo "UNSUPPORTED ARCHITECTURE"
return 1