HomeFreeBSD

elfctl: fix -e invalid operation error handling

Description

elfctl: fix -e invalid operation error handling

Validate the operation prior to parsing the feature string, so that e.g.
-e 0x1 reports invalid operation '0' rather than invalid feature 'x11'.
Also make it an error rather than a warning, so that it is not repeated
if multiple files are specified.

(Previously an invalid operation resulted in a segfault.)

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

Details

Provenance
emasteAuthored on Feb 15 2022, 3:30 AM
Parents
rGf0cf9b602dc0: elfctl: error if -e is specified multiple times
Branches
Unknown
Tags
Unknown