Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 268
Anwar Mohamed Avatar asked Oct 01 '12 00:10

Anwar Mohamed


1 Answers

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.

like image 69
Employed Russian Avatar answered Oct 15 '22 17:10

Employed Russian