On 07/20/10 09:28 AM, Shawn Walker wrote: <snip>
There's some code pkg(5) uses for limited elf analysis in the pkg(5) gate that is designed to interface with python: http://src.opensolaris.org/source/xref/pkg/gate/src/modules/elf.c http://src.opensolaris.org/source/xref/pkg/gate/src/modules/elfextract.c
Interesting, looks like a start.
I don't know how much you need, but maybe it can get you by...
For ELF binary comparison, wsdiff gets a list of section headers (name + type) in get_elfheader() and then compares them via extract_elf_section()/diff_elf_section(). For this it uses elfdump(1) to get information specific for given type (e.g. uses elfdump -G for .got metadata) and dump(1) to get a hex dump. It actually uses dump(1) first to get a coarse view and if the contents/length differs it uses elfdump(1) to get the actual difference in structured view.
v. _______________________________________________ tools-discuss mailing list tools-discuss@opensolaris.org