1

I'm trying to disassemble openSSL that I've built for iOS targeting arm64 architecture with objdump (from GNU binutil) giving it following options:

./objdump openssl -f (file headers), -t (symbol table), and -h (section headers)

but getting following error:

BFD: bfd_mach_o_scan: unknown architecture 0x100000c/0x0
objdump: ./openssl: File format not recognized
TARGET: 
BFD: bfd_mach_o_scan: unknown architecture 0x100000c/0x0

The objdump -v 2.21.1 that I've built with following options:

./configure CC="gcc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -arch i386" CXX="g++ -arch i386" -disable-werror -enable-install-libiberty -enable-targets=arm-eabi

was working fine with all arm 32-bit architectures but failed to disassemble arm64.

Does anyone know how to build objdump to allow calling:

./objdump openssl -f (file headers), -t (symbol table), and -h (section headers)

for binary that was build targeting arm64?

Thanks in advance

marcin
  • 125
  • 1
  • 14

1 Answers1

1

The objdump you're using doesn't know about the arm64 arch. 0x100000c/0x0 is the cputype (CPU_TYPE_ARM64) and cpusubtype CPU_SUBTYPE_ARM64_ALL.

Why use objdump? The otool(1) program works well and is included in the Xcode developer tools / command line tools package. The command line options are a little different but one look at the man page will make it clear how to use it.

Jason Molenda
  • 14,835
  • 1
  • 59
  • 61
  • Thanks for your answer but unfortunately I need to go with objdump. Do you know how to build it to recognize arm64 architecture? or do you know where I can get pre-build version of objdump that can do it? – marcin Nov 27 '14 at 18:46
  • Sorry, I don't know anything about the status of binutils or its releases. I don't know if objdump includes a disassembler -- that would be the most complicated part to add if you were supporting a new ISA like arm64 / AArch64. If objdump can't disassemble things, then adding arm64 support is very simple and I'd recommend looking for a newer version of it. But if it were me, I'd just find a way to use otool to do what you need - they're very similar in what they do. – Jason Molenda Nov 27 '14 at 19:55
  • Thanks for your answer. Would you happen to know how to translate objdump options: -f (file headers), -t (symbol table), and -h (section headers) to equivalent otool options? – marcin Nov 28 '14 at 13:34