Anwar Mohamed
Anwar Mohamed

Reputation: 653

ELF Imports and Exports

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

Answers (1)

Employed Russian
Employed Russian

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

Related Questions