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: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Marc Zyngier <[email protected]>
Acked-by: Will Deacon <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
diff --git a/scripts/decodecode b/scripts/decodecode
index 9cef558..ba8b8d5 100755
--- a/scripts/decodecode
+++ b/scripts/decodecode
@@ -60,6 +60,13 @@
4) type=4byte ;;
esac
+if [ -z "$ARCH" ]; then
+ case `uname -m` in
+ aarch64*) ARCH=arm64 ;;
+ arm*) ARCH=arm ;;
+ esac
+fi
+
disas() {
${CROSS_COMPILE}as $AFLAGS -o $1.o $1.s > /dev/null 2>&1