Ramesh K
Ramesh K

Reputation: 77

objdump: Can't use supplied machine MIPS

I'm getting following error for the disassembling of the object with below command. Object file was generated for MIPS platform.

$objdump -D -m MIPS myobjfile.o

Error:

objdump: Can't use supplied machine MIPS

The snippet I'm attaching for reference from objdump.c

  const bfd_arch_info_type *inf = bfd_scan_arch (machine);

  if (inf == NULL)
      fatal (_("can't use supplied machine %s"), machine);

Can you please help me to get correct assembly code?

Upvotes: 3

Views: 7416

Answers (3)

ste11ar
ste11ar

Reputation: 56

Way late on this, but this solved my problem which is the same as yours but for ARM64(aarch64).

If you're building from source you can enable all target architectures by passing the --enable-targets=all to ./configure:

git clone git://sourceware.org/git/binutils-gdb.git 
cd binutils-gdb
./configure --enable-targets=all
make

This enables objdump to work with all architectures, including MIPS

This is from @soulseekah post here: Using objdump for ARM architecture: Disassembling to ARM

Upvotes: 4

Shlomiza
Shlomiza

Reputation: 31

You should try mips-linux-gnu-objdump. I'm using it as part of binutils-mips-linux-gnu package on my ubuntu 16.04 TLS.

You can download it using apt-get:

$sudo apt-get install binutils-mips-linux-gnu

Then try running:

$mips-linux-gnu-objdump -b binary -m mips -D myobjfile.o

The -b binary stands for binary file format and it's optional.

You should visit https://linux.die.net/man/1/x86_64-linux-gnu-objdump for any further information.

Upvotes: 3

Gobbas
Gobbas

Reputation: 1

Try using capital m. $objdump -D -M MIPS myobjfile.o

[-M options|--disassembler-options=options]

Upvotes: 0

Related Questions