[PATCH] elfclassify tool

Mark Wielaard mark@klomp.org
Sat Jul 20 21:40:00 GMT 2019


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-elfclassify-Add-elfclassify-tests-and-fix-issues-fou.patch
Type: text/x-diff
Size: 22130 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/elfutils-devel/attachments/20190720/a83d98d0/attachment.bin>


More information about the Elfutils-devel mailing list