path: root/scripts/decodecode
diff options
authorMarc Zyngier <>2018-12-28 00:31:21 -0800
committerLinus Torvalds <>2018-12-28 12:11:44 -0800
commitc5cfb62f2bdf51c71ab4b8b33271beab34096c71 (patch)
tree88ffea587b776ca827873893d62dd2627e78007d /scripts/decodecode
parente0b2475a3f36a7a0a001fe552145055da1daf245 (diff)
scripts/decodecode: set ARCH when running natively on arm/arm64
When running decodecode natively on arm64, ARCH is likely not to be set, and we end-up with .4byte instead of .inst when generating the disassembly. Similar effects would occur if running natively on a 32bit ARM platform, although that's even less popular. A simple workaround is to populate ARCH when it is not set and that we're running on an arm/arm64 system. Link: Signed-off-by: Marc Zyngier <> Acked-by: Will Deacon <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'scripts/decodecode')
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/decodecode b/scripts/decodecode
index 9cef558528aa..ba8b8d5834e6 100755
--- a/scripts/decodecode
+++ b/scripts/decodecode
@@ -60,6 +60,13 @@ case $width in
4) type=4byte ;;
+if [ -z "$ARCH" ]; then
+ case `uname -m` in
+ aarch64*) ARCH=arm64 ;;
+ arm*) ARCH=arm ;;
+ esac
disas() {
${CROSS_COMPILE}as $AFLAGS -o $1.o $1.s > /dev/null 2>&1