]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
readelf: return error in case of invalid file
authorEd Maste <emaste@FreeBSD.org>
Mon, 5 Apr 2021 01:01:28 +0000 (21:01 -0400)
committerEd Maste <emaste@FreeBSD.org>
Tue, 13 Apr 2021 18:44:59 +0000 (14:44 -0400)
commit14b0c8e7687e0f5917b4d272bd16a6816cab3d12
treed074102075c8f7566514843436a2712c22e8e771
parent113f92b13ec65a1a298630c06a680997e46a155b
readelf: return error in case of invalid file

GNU readelf exits with an error for a number of invalid file cases.
Previously ELF Tool Chain readelf always exited with 0.  Now we exit 1
upon detecting an error with one or more input files, but in any case
all of them are processed.

This should catch common failure cases.  We still do not report an error
for some types of malformed ELF files, but this is consistent with GNU
readelf.

PR: 252727
Reviewed by: jkoshy, markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29377

(cherry picked from commit ea444392bb5b351c930f28a02a4e68f51b25ba69)
contrib/elftoolchain/readelf/readelf.c