Page MenuHomePhabricator

[llvm-objcopy] Add -F|--target compatibility

Authored by rupprecht on Oct 9 2018, 10:24 AM.



This change adds support for the GNU --target flag, which sets both --input-target and --output-target.

GNU objcopy doesn't do any checking for whether both --target and --{input,output}-target are used, and so it allows both, e.g. "--target A --output-target B" is equivalent to "--input-target A --output-target B" since the later command line flag would override earlier ones. This may be error prone, so I chose to implement it as an error if both are used. I'm not sure if anyone is actually using both.

Diff Detail


Event Timeline

rupprecht created this revision.Oct 9 2018, 10:24 AM
jakehehrlich accepted this revision.Oct 9 2018, 12:17 PM

I think this is probably fine. I think having the error is better than not having it. I'm just concerned someone somewhere is using GNU objcopy in the way mentioned in the error. I'm fine treating this as an error and only switching behavior if and when someone hits an issue.

So LGTM. I'd wait on one more person to cast their vote on this situation.

This revision is now accepted and ready to land.Oct 9 2018, 12:17 PM
alexshap accepted this revision.EditedOct 11 2018, 4:40 PM

thanks, sorry for causing you to rebase

This revision was automatically updated to reflect the committed changes.
jhenderson added inline comments.Oct 15 2018, 11:48 AM

What's this TODO about?

rupprecht added inline comments.Oct 15 2018, 1:09 PM

D'oh, forgot to remove the TODO after I implemented the test case
Will remove this in a separate commit, thanks for noticing this!