OSDN Git Service

Improve file's ELF parsing.
authorElliott Hughes <enh@google.com>
Sun, 29 Jan 2017 20:35:54 +0000 (12:35 -0800)
committerRob Landley <rob@landley.net>
Mon, 30 Jan 2017 21:49:40 +0000 (15:49 -0600)
commitfa84155632bf1c65f455b9872ee35a53cd0d2a19
tree4aeb265f200682fb44b03067634ac79275b9f25e
parent2fcb232df138218438eab508705d4c40d460be69
Improve file's ELF parsing.

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