The IAR compiler has the -l
option for generating Assembly files from C sources.
-l[c|C|D|E|a|A|b|B][N][H] file|directory
Output list file
c C source listing
C with assembly code
D with pure assembly code
E with non-sequential assembly code
a Assembler file
A with C source
b Basic assembler file
B with C source
N Do not include diagnostics
H Include header file source lines
Example for generating file.s from file.c:
iccarm -lb . file.c -o file.o
With only a binary without its sources, you will need a 3rd party utility such as IDA Pro, arm-none-eabi-objdump
, or similar.
One example, with arm-none-eabi-objdump
:
arm-none-eabi-objdump -b binary -marm -Mforce-thumb -D <file>.bin
Either way, the binary won't give you symbolic names nor sections as you would be able to dump from an ELF. Moreover you have to inform if the executable was built for targets using thumb instructions (-Mforce-thumb
).
In the end, dumping a raw binary will give, in the best case, educated guesses about the raw picture of the entire executable.
Good luck.