]> granicus.if.org Git - llvm/commit
[llvm-objcopy] Default --output-target to --input-target when unspecified
authorFangrui Song <maskray@google.com>
Sat, 14 Sep 2019 01:36:16 +0000 (01:36 +0000)
committerFangrui Song <maskray@google.com>
Sat, 14 Sep 2019 01:36:16 +0000 (01:36 +0000)
commit9c01fe05637edd2ff921d974d8e5efe514998af8
treef215507263e6eccb011d3bb62283fc8bb4b6b8a0
parentc66dffe7038e63710d3b37824081daa570cb9706
[llvm-objcopy] Default --output-target to --input-target when unspecified

Fixes PR42171.

In GNU objcopy, if -O (--output-target) is not specified, the value is
copied from -I (--input-target).

```
objcopy -I binary -B i386:x86-64 a.txt b       # b is copied from a.txt
llvm-objcopy -I binary -B i386:x86-64 a.txt b  # b is an x86-64 object file
```

This patch changes our behavior to match GNU. With this change, we can
delete code related to -B handling (D67215).

Reviewed By: jakehehrlich

Differential Revision: https://reviews.llvm.org/D67144

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371913 91177308-0d34-0410-b5e6-96231b3b80d8
test/tools/llvm-objcopy/ELF/binary-input-and-output.test
test/tools/llvm-objcopy/ELF/binary-input-error.test
test/tools/llvm-objcopy/ELF/binary-input.test
test/tools/llvm-objcopy/ELF/binary-output-target.test [moved from test/tools/llvm-objcopy/ELF/binary-input-arch.test with 72% similarity]
test/tools/llvm-objcopy/ELF/new-symbol-visibility.test
tools/llvm-objcopy/CopyConfig.cpp