On Fri, Jul 19, 2019 at 02:47:09PM +0200, Mark Wielaard wrote: > The individual commits can be found here: > https://code.wildebeest.org/git/user/mjw/elfutils/log/?h=elfclassify > > Please let me know if any of this looks bad or unusual. > > I'll write some testcases. And as always when writing tests you find some corner cases :) So the attached is some testcases plus some fixes: - Handle files without sections (only phdrs), in particular handle PT_DYNAMIC directly (not through a section). - is_loadable should check whether it isn't a debug-only file (but only if there are section headers, if not, it cannot be debug-only). - For .debug_only we can also have just a .symtab (but no .debug sections). And any allocated section makes it not-debug-only (except for SHT_NOBITS or SHT_NOTE) - Detect .zdebug sections too (old GNU compressed ELF sections). Cheers, Mark