This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objcopy] Add -o option to llvm-objcopy
AbandonedPublic

Authored by jakehehrlich on Dec 12 2017, 12:06 PM.

Details

Reviewers
phosek
jhenderson
Summary

llvm-objcopy needs to have an llvm-strip alias. The llvm-strip alias needs to be command line compatible with GNU strip. This change adds a -o option to llvm-objcopy to allow the user to specify the output file name using -o rather than a positional argument.

Diff Detail

Repository
rL LLVM

Event Timeline

jakehehrlich created this revision.Dec 12 2017, 12:06 PM

There's an issue here, based on my reading of the man page for strip. Strip takes a list of objects that are to be stripped, and modifies them in place. As things stand, this patch will mean llvm-strip a.o b.o will strip a.o and emit it as b.o, which is a potentially very confusing issue if trying to use it as a drop-in replacement. I don't mind if you don't at this point support multiple inputs, but I think that the implicit output needs to be illegal for llvm-strip.

Aside from that, this change looks fine to me.

There's an issue here, based on my reading of the man page for strip. Strip takes a list of objects that are to be stripped, and modifies them in place. As things stand, this patch will mean llvm-strip a.o b.o will strip a.o and emit it as b.o, which is a potentially very confusing issue if trying to use it as a drop-in replacement. I don't mind if you don't at this point support multiple inputs, but I think that the implicit output needs to be illegal for llvm-strip.

Aside from that, this change looks fine to me.

Yikes! I didn't realize this worked this way. I think a more drastic change is required now. I'm looking at not using the symlink option because it seems like it would just be better if I had different options for each executable.

jakehehrlich abandoned this revision.Dec 19 2017, 12:01 PM