0

I got an executable files that are send to a microcontroller. I have .bin .elf .hex, .ihex and .map I am trying to put out from them all the information about objects, their addresses, type etc. For what I know .elf file contains all this information, and .hex and .map it would be necessary to move between these two. Readelf is working perfectly well, but I want to see what I will get using objdump. So, I am trying to decode .elf file.

After command objdump -M intel -d <filename.elf> I get the message: can't disassemble for architecture UNKNOWN.

Do you know what can I do about it? Does it mean that objdump cannot be used or I need to search for the architecture? I read a lot about that for now but still with no result.

Any of you had this problem?

  • Also, when I use gold linker I get: gold: fatal error: Raypay_Rx06.elf: unsupported ELF machine number 40 – Amanda Stein Sep 13 '21 at 08:09
  • Looks like your toolchain doesn't support the architecture that was used in this file. You need to use an objdump that supports your microcontroller. – PMF Sep 13 '21 at 08:12
  • I tried to specify -I elf32-little too but with no result – Amanda Stein Sep 13 '21 at 08:22
  • @PMF how to do that? I dont understand what should I do rn – Amanda Stein Sep 13 '21 at 08:22
  • What microcontroller is that? What compiler was used to build the file you want to look at? If you don't know this, it won't be possible to properly disassemble it. – PMF Sep 13 '21 at 08:28
  • @PMF I dont know any of that since all I have is 5 files with different format. Let's say I will possess the info about the microcontroller and the compiler. What next? I just specify it in the commad line? – Amanda Stein Sep 13 '21 at 08:40
  • I am reading about cargo-binutils. https://github.com/rust-embedded/cargo-binutils/blob/master/README.md Do you think it may work? – Amanda Stein Sep 13 '21 at 08:42
  • I have no idea. Without knowledge of the CPU type you're working with, it's unlikely you will get anything usable. You'll also need to know the assembly of that CPU type to be able to read the code, if ever you get at it. – PMF Sep 13 '21 at 09:57
  • @PMF its ARM CPU – Amanda Stein Sep 13 '21 at 14:17
  • 1
    Then you might need to look at something like an ARM crosscompiler. Some Arduino toolchains are for ARM (i.e Arduino Due). Whether they include a disassembler, I don't know, though. – PMF Sep 13 '21 at 16:31

0 Answers0