xen: Introduce $AWK in check-endbr.sh

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Anthony PERARD authored and Andrew Cooper committed 2022-07-15 12:55:16 +01:00
1 parent 355caa9ef2
commit f717590f57
1 file changed
+3 -2
+3 -2
View File
@@ -10,6 +10,7 @@ MSG_PFX="${0##*/} ${1##*/}"
OBJCOPY="${OBJCOPY:-objcopy}"
OBJDUMP="${OBJDUMP:-objdump}"
ADDR2LINE="${ADDR2LINE:-addr2line}"
AWK="${AWK:-awk}"
D=$(mktemp -d)
trap "rm -rf $D" EXIT
@@ -64,7 +65,7 @@ ${OBJDUMP} -j .text $1 -d -w | grep ' endbr64 *$' | cut -f 1 -d ':' > $VALID &
# numbers, which don't lose precision.
#
eval $(${OBJDUMP} -j .text $1 -h |
awk '$2 == ".text" {printf "vma_hi=%s\nvma_lo=%s\n", substr($4, 1, 8), substr($4, 9, 16)}')
$AWK '$2 == ".text" {printf "vma_hi=%s\nvma_lo=%s\n", substr($4, 1, 8), substr($4, 9, 16)}')
${OBJCOPY} -j .text $1 -O binary $TEXT_BIN
@@ -78,7 +79,7 @@ then
else
grep -aob -e "$(printf '\363\17\36\372')" -e "$(printf '\363\17\36\373')" \
-e "$(printf '\146\17\37\1')" $TEXT_BIN
fi | awk -F':' '{printf "%s%x\n", "'$vma_hi'", int(0x'$vma_lo') + $1}' > $ALL
fi | $AWK -F':' '{printf "%s%x\n", "'$vma_hi'", int(0x'$vma_lo') + $1}' > $ALL
# Wait for $VALID to become complete
wait
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.