I want to disassemble i386 machine instructions into human readable text in Raspbian.

I am a rookie Linux user and don't know the configuration of installed tools, but from what I understand I need an architecture for i386 for objdump.

objdump -D -b binary -mi386 -Maddr16,data16 binfile

    binfile: file format binary

    objdump: can't use supplied machine i386

Indeed, looking at the supported architectures in objdump, I can see i386 is not included.

objdump: supported architectures: arm armv2 armv2a armv3 armv3m armv4 
         armv4t armv5 armv5t armv5te xscale ep9312 iwmmxt iwmmxt2 plugin

How can I add i386 architecture to the list of supported architectures? Is it a pluggable definition I can just download and place in a particular location? Or do I need to modify and make a new objdump executable?

  • llvm-objdump may be able to (depending, I think, on how it was built). llvm-objdump --version will tell you. – greggo Nov 17 '15 at 19:04
  • Thank you @greggo, but it does not appear to be installed in Raspbian GNU/Linux 8(jessie) by default. I'll look into obtaining this tool once I figure out where and how I can obtain it. – Statement Nov 17 '15 at 20:59

I have not tried it, but there is a binutils-multiarch package "used to manipulate binary and object files that may have been created on other architectures". It includes an objdump which from the looks of things will replace the existing one. The other files are listed here.

So, worth trying:

apt-get install binutils-multiarch

And seeing if the new objdump meets your needs.

|improve this answer|||||
  • Worked as a charm! – Statement Nov 17 '15 at 21:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.