HomeFreeBSD

readelf: return error in case of invalid file

Description

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)

Details

Provenance
emasteAuthored on Apr 23 2021, 3:37 PM
Reviewer
markj
Differential Revision
D29377: readelf: return error in case of invalid file
Parents
rG44a0bdad29d7: sysctl vm.objects: report backing object and swap use
Branches
Unknown
Tags
Unknown