I'm working with DWARF parser that looks for string data in the .debug_str
section. In the ELF files I'm parsing, the string data is in the .strtab
section. What's the difference between these two sections? Both contain strings, right?
In a DWARF file, what's the difference between .debug_str and .strtab?
2.8k views Asked by watkipet At
1
They have ~nothing to do with each other.
Well, yes. And every section contains bytes, so next you'll be asking "what's the difference between
.text
and.data
?".The
.debug_str
section contains debug strings, which are needed for debugging. The.strtab
section contains symbol names which are needed for (static) linking.Neither section (in fact no section) is needed at runtime.
.strtab
is usually present in final executable built with or without-g
andNot very useful, is it? Compare to unstripped binary: