[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231129-objdump-reformat-llvm-v3-2-0d855e79314d@kernel.org>
Date: Wed, 29 Nov 2023 15:17:42 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com
Cc: x86@...nel.org, ndesaulniers@...gle.com, keescook@...omium.org,
samuelzeter@...il.com, mhiramat@...nel.org,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev,
patches@...ts.linux.dev, Nathan Chancellor <nathan@...nel.org>
Subject: [PATCH v3 2/3] x86/tools: objdump_reformat.awk: Allow for spaces
From: Samuel Zeter <samuelzeter@...il.com>
GNU objdump and LLVM objdump have differing output formats.
Specifically, GNU objump will format its output as: address:<tab>hex,
whereas LLVM objdump displays its output as address:<space>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 <mhiramat@...nel.org>
Tested-by: Nathan Chancellor <nathan@...nel.org>
Reviewed-by: Kees Cook <keescook@...omium.org>
Tested-by: Kees Cook <keescook@...omium.org>
Signed-off-by: Samuel Zeter <samuelzeter@...il.com>
Signed-off-by: Nathan Chancellor <nathan@...nel.org>
---
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
Powered by blists - more mailing lists