All Sun Studio
distributions [that I am aware of] contain a utility program named dwarfdump
; as is
apparent from its name, dwarfdump
can print DWARF information
contained in an ELF executable or shared object. There also exists
third type of ELF files - relocatable files; those are object files
(.o) produced by a compiler that can be linked together to produce
another relocatable file (.o) or executable/shared library.
One would expect dwarfdump to handle
all types of ELF files, but until recently, dwardump would often
crash when dumping debug information of a relocatable file on x64 and sparcv9 binaries. In this post
I'll explain the reasons for crash and why relocation records
processing is important when reading DWARF.