Objdump ARM aarch64 code?

in3o picture in3o · Aug 21, 2014 · Viewed 8.6k times · Source

I have an elf arm aarch64 binary and i want to disassemble it .text section using objdump.My machine is amd64.

I tried Using objdump for ARM architecture: Disassembling to ARM but objdump is not identifying the binary so not able to disassemble it.

Answer

auselen picture auselen · Aug 21, 2014

Go to http://releases.linaro.org/latest/components/toolchain/binaries/ and get your choice of gcc-linaro-aarch64-linux-gnu-4.9-* like for example gcc-linaro-aarch64-linux-gnu-4.9-2014.07_linux.tar.bz2.

After unpacking invoke aarch64-linux-gnu-objdump, ie:

echo "int main(void) {return 42;}" > test.c
gcc-linaro-aarch64-linux-gnu-4.9-2014.07_linux/bin/aarch64-linux-gnu-gcc -c test.c
gcc-linaro-aarch64-linux-gnu-4.9-2014.07_linux/bin/aarch64-linux-gnu-objdump -d test.o

to get objdump.

test.o:     file format elf64-littleaarch64


Disassembly of section .text:

0000000000000000 <main>:
   0:   52800540    mov w0, #0x2a                   // #42
   4:   d65f03c0    ret