This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objcopy] Fix the exit code
ClosedPublic

Authored by alexander-shaposhnikov on May 7 2018, 1:42 PM.

Details

Summary

Set the exit code (llvm-objcopy/llvm-strip) to 1 if no arguments are specified
(binutils objcopy does the same).

Test plan: make check-all

Diff Detail

Repository
rL LLVM

Event Timeline

in case of misuse print the help message to stderr (like binutils objcopy does)

jakehehrlich accepted this revision.May 7 2018, 2:34 PM

LGTM I checked that this is consistent with objcopy (and it would seem other tools as well). Seems acceptable to me as is.

This revision is now accepted and ready to land.May 7 2018, 2:34 PM
tools/llvm-objcopy/llvm-objcopy.cpp
492–497

(just in case - this class doesn't have empty() (yet) - that's why it's a little bit more verbose than probably it could be)

This revision was automatically updated to reflect the committed changes.