Skip to content

Commit

Permalink
scripts/decodecode: set ARCH when running natively on arm/arm64
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Marc Zyngier authored and torvalds committed Dec 28, 2018
1 parent e0b2475 commit c5cfb62
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/decodecode
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ case $width in
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

Expand Down

0 comments on commit c5cfb62

Please sign in to comment.