Lenny
Lenny

Reputation: 398

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?

Upvotes: 1

Views: 2668

Answers (1)

Employed Russian
Employed Russian

Reputation: 213636

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.

Upvotes: 5

Related Questions