From patchwork Thu Jul 14 14:39:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 12918067 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2E1CEC43334 for ; Thu, 14 Jul 2022 14:39:47 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.367664.598763 (Exim 4.92) (envelope-from ) id 1oBzzs-0002zj-Pb; Thu, 14 Jul 2022 14:39:20 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 367664.598763; Thu, 14 Jul 2022 14:39:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oBzzs-0002zc-MZ; Thu, 14 Jul 2022 14:39:20 +0000 Received: by outflank-mailman (input) for mailman id 367664; Thu, 14 Jul 2022 14:39:19 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oBzzr-0002UF-AM for xen-devel@lists.xenproject.org; Thu, 14 Jul 2022 14:39:19 +0000 Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id bcdc8d90-0382-11ed-924f-1f966e50362f; Thu, 14 Jul 2022 16:39:18 +0200 (CEST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: bcdc8d90-0382-11ed-924f-1f966e50362f DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1657809558; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dERAYYpHGNdDoJC+KVVotxHQ1VnjUBp5rhHFM0sXzE4=; b=MCK7bo/vXRh/8qb5578TiMBgnU8smrPJn9woVb8DeQdq1pPIr8TduhaM kOuhHxJJfIEvRuymF+z5bmX6bsr7chnRXwLYcaNhxL2ycEAD4kdtfWn6o VnUQdKTNDuTcpXrjJU9FtzMtfbT3sTg23AMUxTX8l1CdXeo2QExuYoZAU 4=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 5.1 X-MesageID: 75798792 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:iXDNOq6KkQbvo+zrfQ9WOwxR2vbMJYB3ticv2ybIaGNq3BzvzP6J+z/mGEsNoGQgghEXUqHF+SBmUu4agP2hTNrF5aKgZyR3R4P4GA0qI50YOLPjud6PHCHi/1pOz2/MjEBijBIvfJmnoJTSD1r450U94P76CxccJKfJwXAzxWyrM2mO8kNp34j21uwmza5YK9eBcDdZSSM+Oq8WgedLlLy7LilHHkFyRhaeczJEz38cw76laVo7i5/olpY3zrGbZTnTuBmPOdoJkVvFfxEnVVVg360t0pFhwiBmhiHjbr8cMbtbjo+MxvjrSTtQ14DTU7v0YL5xmn7tVwsVS2OnkB7RrGaQ5kH5IjXSUlG/oWRqcQwqOaK1Wu1D3LpBxiW87lG3SAH5N/fg3oRM6/k6U0A3yZsiFP/omaov9OXhyoMRQxzp9yi5up3rlFIdv7ZUq/7JYNBaSTFeeQkGSGtzhx4zrXhFnn0YOA4mZiCDtojdWaPEMBCDvwQ6QqXpy+elXXQ/gx1oLtf2l+HpiQTTor8PWQ4yo3x/Oqr0Sg35Bc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4y6ah/qbx3DLMAMqrmkmtasd8q/rRacCdYyN7h+Qm0B0UHbIRw412VaWF4jEjK1ewdc/5CrGlZtDWngAiTR1wW3g== X-IronPort-AV: E=Sophos;i="5.92,271,1650945600"; d="scan'208";a="75798792" From: Anthony PERARD To: CC: Anthony PERARD , Andrew Cooper , George Dunlap , "Jan Beulich" , Julien Grall , "Stefano Stabellini" , Wei Liu Subject: [XEN PATCH 2/2] xen: Introduce $AWK in check-endbr Date: Thu, 14 Jul 2022 15:39:07 +0100 Message-ID: <20220714143907.25938-3-anthony.perard@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220714143907.25938-1-anthony.perard@citrix.com> References: <20220714143907.25938-1-anthony.perard@citrix.com> MIME-Version: 1.0 Signed-off-by: Anthony PERARD Acked-by: Andrew Cooper --- xen/tools/check-endbr.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/tools/check-endbr.sh b/xen/tools/check-endbr.sh index 64fa9a56b7..523797a15f 100755 --- a/xen/tools/check-endbr.sh +++ b/xen/tools/check-endbr.sh @@ -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