[Toybox] [PATCH] Improve file's ELF parsing.

enh enh at google.com
Mon Jan 30 11:14:41 PST 2017


An ELF file with no program headers is valid, and binutils leaves e_phentsize
zero in that case. Fix the corruption check to cope.

Also, since notes are in both the program and section headers (and I'm not
aware of the possibility of having no sections but still having notes ---
where would they be?), look for them in the section headers instead.

Also extend the parsing of the .android.note.ident ELF note to include the
NDK version information if present. (This won't be present for platform
binaries, but will be present for NDK-built binaries such as app libraries.)
---
 toys/posix/file.c | 65 +++++++++++++++++++++++++++++++++----------------------
 1 file changed, 39 insertions(+), 26 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Improve-file-s-ELF-parsing.patch
Type: text/x-patch
Size: 5477 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20170130/e02a480d/attachment.bin>


More information about the Toybox mailing list