[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XEN PATCH 1/2] xen: Fix check-endbr with mawk
- To: Anthony Perard <anthony.perard@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
- Date: Thu, 14 Jul 2022 18:24:42 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nig3n99PepNWWrv6rObTVnq+5T0F8QPKeXChqjVlbWA=; b=h4tymM3Q+jMu3FzyWHL8WtIaZn4S44KM+8AiAoa7KgT7AiynVd9/WPTQ5EPQbUl+SA1jQd1NWj3oDPsXw+KPGEO1+cW39acdrSyEExQnFQpHIEoxfHXK3NFSAQP0hA7oqf5aJDWBHJo23eXkVJPKElbNrKlYbiS9/pUXphKZgCA68JhWi+QYNewtzvaNayxPMtEHTifSrIVy5XixkJpU68RUBdc+fJEWlb0ELu/pbtcetkMWy3HzQvbHY8G+Fflxqz5hpzBpC/+JXz/BFdMMGzKe7R3kK53MtoKKi6AB4/XKYhizazndoKMi06RPXG8J5ytphCVjnIcftjoflANFtQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IFY90l9qWo6WCjq1WCPhIbgucKS7Ae5w9qMtK99sFATo41Rb9IQJ7LCNNk/O/IvaEB9Y0jOQvk1wTRBi5m0YZGZ6yoL84WLrwxN445+MAGl8X+hp0VoR6z4PiOk+N5Dx3naw2u1f42eke+OJ4zAgId6N43W6F0SNV+6XsHqbkFNASBGn2MnlFFE7YBbSAFOQ4MXRH24x3yqfJ2WPvyy2lu8T2q0glGecUzQgobK5hqyNpMPZOUjHMJKSopUrpK27OXuEJa6wJDv2PVgswCldx3erQKhqbRwkbPnZeeyJOZq1s+S0++VUbMSRAHuFJ8lISjXKPzrTE29zDIF6UYLylQ==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Luca Fancellu <Luca.Fancellu@xxxxxxx>, Mathieu Tarral <mathieu.tarral@xxxxxxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
- Delivery-date: Thu, 14 Jul 2022 18:25:16 +0000
- Ironport-data: A9a23:CqexVKjJF2ipjiMX5CgKXIWTX161nxEKZh0ujC45NGQN5FlHY01je htvXj+BO/6CYzOjLdF3Oty/8BwEsMDdn9U2TQJp+3s3RXkb9cadCdqndUqhZCn6wu8v7a5EA 2fyTvGacajYm1eF/k/F3oDJ9CU6j+fQLlbFILasEjhrQgN5QzsWhxtmmuoo6qZlmtH8CA6W0 T/Ii5S31GSNhnglaAr414rZ8Ek15Kur5GtD1rADTasjUGH2xiF94K03fcldH1OgKqFIE+izQ fr0zb3R1gs1KD90V7tJOp6iGqE7aua60Tqm0xK6aID76vR2nQQg075TCRYpQRw/ZwNlPTxG4 I4lWZSYEW/FN0BX8QgXe0Ew/ypWZcWq9FJbSJQWXAP6I0DuKhPRL/tS4E4eJdQp5tRYL291s uUVLmAgdDylqc7nz+fuIgVsrpxLwMjDGqo64ysl4RSHSPEsTNbEXrnA4sJe0HEonMdSEP3CZ s0fLz1ycBDHZB4JMVASYH48tL7w2j+jLHsF+RTM+vFfD2v7lWSd1JDENtbPd8PMbsJShkuC/ UrN/njjAwFcP9uaoda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eJP7dSueVVspj8ys5/0CH8yzYY fABK5r
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHYl4+Dg7FHxwiGFEGkNOu8rM/Cw61+LtiA
- Thread-topic: [XEN PATCH 1/2] xen: Fix check-endbr with mawk
On 14/07/2022 15:39, Anthony PERARD wrote:
> diff --git a/xen/tools/check-endbr.sh b/xen/tools/check-endbr.sh
> index 552f233912..64fa9a56b7 100755
> --- a/xen/tools/check-endbr.sh
> +++ b/xen/tools/check-endbr.sh
> @@ -78,7 +78,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
I thought I'd found a cunning way to simply this, but alas.
Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, but this
warrants a comment, so I've added this hunk too:
diff --git a/xen/tools/check-endbr.sh b/xen/tools/check-endbr.sh
index f633846b0f79..80955f74c71c 100755
--- a/xen/tools/check-endbr.sh
+++ b/xen/tools/check-endbr.sh
@@ -64,6 +64,11 @@ ${OBJDUMP} -j .text $1 -d -w | grep ' endbr64
*$' | cut -f 1 -d ':' > $VALID &
# split the VMA in half so AWK's numeric addition is only working on
32 bit
# numbers, which don't lose precision.
#
+# 4) MAWK doesn't support plain hex constants (an optional part of the
POSIX
+# spec), and GAWK and MAWK can't agree on how to work with hex constants
+# in a string. Use the shell to convert $vma_lo to decimal before
passing
+# to AWK.
+#
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)}')
|