Search code examples
cobjdumpobject-files

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?


Solution

  • 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