Search code examples
filelinkerelfobjdumpreadelf

What's the difference between .data, .symtab in an ELF file?


My understanding is that .data stores the initialized global variables of the program. But isn't that what .symtab stores as well?


Solution

  • But isn't that what .symtab stores as well?

    No. The .symtab is a table of symbols (usually examined with nm command); its contents has nothing to do with the contents of global variables.

    It does describe global and static variables and functions, and also can be completely removed without loss of functionality of the original binary.