Reputation: 653
i know we have .dynsym
and .symtab
, how can i differentiate between imports and exports , like in pe in windows, imports and exports are in data directories, is it and equivalent in elf?
Upvotes: 7
Views: 3806
Reputation: 213526
how can i differentiate between imports and exports
Easy: any symbol in the dynamic symbol table (in .dynsym
) for which .st_shndx == SHN_UNDEF
(references special UND
section) is an import, and every other symbol is defined and exported.
Note that .symtab
doesn't matter and can be completely stripped -- the dynamic loader never looks at it.
Upvotes: 7