Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4903917rdh; Wed, 29 Nov 2023 14:18:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IFJ5fOAI+oR2aBIQFJN+gacoXlSAuzF+48OUxQkFuLhOfQGnNbj/2skOhumF8PKLFVv668A X-Received: by 2002:a05:6a21:2711:b0:18b:1f3c:eeb9 with SMTP id rm17-20020a056a21271100b0018b1f3ceeb9mr18227138pzb.36.1701296295622; Wed, 29 Nov 2023 14:18:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701296295; cv=none; d=google.com; s=arc-20160816; b=OX6mCnPVbPXw9gmP7B7P92/VV3EymdoUEbsCtIZ1VWhdE8Ai5raF+1fiAWvh8Gj2YJ pPgC85N+VMBEIXwK52l4BM/ekA7zMXnMZGdSo5xH9VIdp6mtE8yb+cje7h/Yk8XBU4Kn cEo49BfsYRTz+Rylq2NAgRPGozl6NnJ0tkUSy7IUp3ciY5KNmLGTGljUd7eBUfmqf35S GBnFsR1msT4a741nsauhfhIZy89TCotVJbrAeuw14POoD2VzoCgUeMYzpUW2/I1n/Mn8 Ar+ZpAGtGaBkqZSBJkfEJiKY7mqpcPKkRmtdqOBd1TlKlW+bLtCme1OSmnqE5znod9G+ a6bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=992qTw/uy7RcragYSzxQI5xUuulafDa5UfKLVAEXvpE=; fh=VuE012xvnkbmKdVz6qCJ/DYLIa42Cu/uD91abXTRPQU=; b=A7IDUt9InHok368f1dCCf3U3PLVWJJyMgoZXxAQqgCNs8212bm77CPa2Q/Gi4XTYOX HiHW7GweY79tsrfk1WgJsKVWbznZYnPA1+SkN8OeFy+k5bRKTllPX+ifVMvy6GsheDQN MvvZc/s+685Li8Zu/Nq8HtHcEjtrbpe4EaeoRNzachVl7NVSMz50UDPxVvDIY2aFaviw KprMldTIU8AOIYkaSLGb8ARqyOmLOESpQIyKPHj4RLK3Z1GcTEw2LRrWl4ncc6IFTCq7 EDsNhmrFY5TgHO2VXjBN4BSV/1d/jktakfXe7k+SoPbO1gg64GaRZD87p7CYbXKvzOZH KvMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F3vkcUrb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id 3-20020a631543000000b005b92a7d88e6si14992844pgv.823.2023.11.29.14.18.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 14:18:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F3vkcUrb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id A187F802C7C3; Wed, 29 Nov 2023 14:18:14 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234866AbjK2WR7 (ORCPT + 99 others); Wed, 29 Nov 2023 17:17:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229611AbjK2WRx (ORCPT ); Wed, 29 Nov 2023 17:17:53 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9164DBD for ; Wed, 29 Nov 2023 14:17:59 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B968C433CD; Wed, 29 Nov 2023 22:17:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701296279; bh=hd6/cveEUNsa+JSOFRwRWxLeImJJ4mFqSehJRZNpmqg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=F3vkcUrbC9fWRuaqydSqSzMnS4KrvklUnCQDUM+XP/oKoItOMpu98Bi3SY13DSz/P cDtJLUrBfefCqkbsxto5aYavpQY+yoG3B64NcIJPuY9Qcp9SRrU1jfppB+dzVHYG0V gXE6e136klP5+q8LmaS30w0wuJ9Q5FrtZ61mpDPuw8QXhs3e3XFUDzlBrJ+KLuRs5i pk9DCDJioatUD9aaAqkcoPOyslb4mVXL+Fk1SWo4fDxBbJnsi80ksLTl2vhU1v4E2B LTYHh2nmmNX/M5UKLRfGPqIiSd3ZO9a+RUdisQ0mtqWtekbQEN2wuwdf3bcBK3p3bM X4o8SxoIHTjMg== From: Nathan Chancellor Date: Wed, 29 Nov 2023 15:17:42 -0700 Subject: [PATCH v3 2/3] x86/tools: objdump_reformat.awk: Allow for spaces MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231129-objdump-reformat-llvm-v3-2-0d855e79314d@kernel.org> References: <20231129-objdump-reformat-llvm-v3-0-0d855e79314d@kernel.org> In-Reply-To: <20231129-objdump-reformat-llvm-v3-0-0d855e79314d@kernel.org> To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com Cc: x86@kernel.org, ndesaulniers@google.com, keescook@chromium.org, samuelzeter@gmail.com, mhiramat@kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, patches@lists.linux.dev, Nathan Chancellor X-Mailer: b4 0.13-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=1362; i=nathan@kernel.org; h=from:subject:message-id; bh=JQyd5OlWKOWs6EDp0gJ7kaEqsFs19g/OI4Sr1wB1jyI=; b=owGbwMvMwCUmm602sfCA1DTG02pJDKnpO6Y45azZaWJU3r5C8pj7naR1l/T5G3oUhSb0pcokM kzZf2NlRykLgxgXg6yYIkv1Y9XjhoZzzjLeODUJZg4rE8gQBi5OAZhIrzAjQ8unR2FudaeevFBf LigS/VHRq/Qp78ytJ2/+bpzi0bjH1JLhn3FLaZTx264pmbKF1l2febQeOu3n4Cp/bhIrN8fS7FE rMwA= X-Developer-Key: i=nathan@kernel.org; a=openpgp; fpr=2437CB76E544CB6AB3D9DFD399739260CB6CB716 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 29 Nov 2023 14:18:14 -0800 (PST) From: Samuel Zeter GNU objdump and LLVM objdump have differing output formats. Specifically, GNU objump will format its output as: address:hex, whereas LLVM objdump displays its output as address:hex. objdump_reformat.awk incorrectly handles this discrepancy due to the unexpected space and as a result insn_decoder_test fails, as its input is garbled. The instruction line being tokenized now handles a space and colon, or tab delimiter. Closes: https://github.com/ClangBuiltLinux/linux/issues/1364 Acked-by: Masami Hiramatsu Tested-by: Nathan Chancellor Reviewed-by: Kees Cook Tested-by: Kees Cook Signed-off-by: Samuel Zeter Signed-off-by: Nathan Chancellor --- arch/x86/tools/objdump_reformat.awk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/tools/objdump_reformat.awk b/arch/x86/tools/objdump_reformat.awk index 276e572a6f60..a4120d907277 100644 --- a/arch/x86/tools/objdump_reformat.awk +++ b/arch/x86/tools/objdump_reformat.awk @@ -22,7 +22,7 @@ BEGIN { } /^ *[0-9a-f]+:/ { - if (split($0, field, "\t") < 3) { + if (split($0, field, /: |\t/) < 3) { # This is a continuation of the same insn. prev_hex = prev_hex field[2] } else { -- 2.43.0