1

I am trying to use objdump to display source as well as disassembly using the -S option. I am running objdump on cygwin. I built objdump for ARM on cygwin. Compiler for build was gcc.

The elf file was built for ARM processor using Thumb2 instruction set using TI ARM compiler.

I am able to run objdump to just extract the disassembly(using -d option). However, I am getting a Segmentation fault when I try to use it to display source as well. It crashes as soon as it reaches the .text section. The output of using objdump -Mforce-thumb -S prog.out is:

prog.out: file format elf32-littlearm

Disassembly of section .text:

000000c0 <add_function>:
Segmentation fault (core dumped)

TSG
  • 877
  • 1
  • 6
  • 23

1 Answers1

0

Objdump is not a decompiler, but a disassembler. Disassembly is (comparatively) simple, provided the binary is not using anti-disassembly tricks. Decompilation, by contrast, is a very difficult thing to do, and objdump makes no attempt to do it. It can only dump source if the binary included it. That's not exactly common for native binaries, but from what I heard, Java binaries tend to include source.

EOF
  • 6,273
  • 2
  • 26
  • 50
  • I read somewhere(I cannot find the exact link right now) that ELF-files store the absolute path to the source if compiled with the -g option. `objdump` is supposed to use that information to display source. It is no decompiler. I have also been able to use the -dwarf=decodedlines option to find source file line information. What could be the reason for the segmentation fault? – TSG Jun 26 '14 at 08:39