summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-objcopy/ELF/binary-input-error.test
Commit message (Collapse)AuthorAgeFilesLines
* [llvm-objcopy] Ignore -B --binary-architecture=Fangrui Song2019-09-141-4/+2
| | | | | | | | | | | | | | | | | | | | | | | GNU objcopy documents that -B is only useful with architecture-less input (i.e. "binary" or "ihex"). After D67144, -O defaults to -I, and -B is essentially a NOP. * If -O is binary/ihex, GNU objcopy ignores -B. * If -O is elf*, -B provides the e_machine field in GNU objcopy. So to convert a blob to an ELF, `-I binary -B i386:x86-64 -O elf64-x86-64` has to be specified. `-I binary -B i386:x86-64 -O elf64-x86-64` creates an ELF with its e_machine field set to EM_NONE in GNU objcopy, but a regular x86_64 ELF in elftoolchain elfcopy. Follow the elftoolchain approach (ignoring -B) to simplify code. Users that expect their command line portable should specify -B. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D67215 llvm-svn: 371914
* [llvm-objcopy] Default --output-target to --input-target when unspecifiedFangrui Song2019-09-141-4/+0
| | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 371913
* [llvm-objcopy] Changed command line parsing errorsAlex Brachet2019-06-141-2/+2
| | | | | | | | | | | | | | | | Summary: Tidied up errors during command line parsing to be more consistent with the rest of llvm-objcopy errors. Reviewers: jhenderson, rupprecht, espindola, alexshap Reviewed By: jhenderson, rupprecht Subscribers: emaste, arichardson, MaskRay, llvm-commits, jakehehrlich Tags: #llvm Differential Revision: https://reviews.llvm.org/D62973 llvm-svn: 363350
* [llvm-objcopy][NFC] More error cleanupJordan Rupprecht2019-02-211-2/+2
| | | | | | | | | | | | | | | | | | | Summary: This removes calls to `error()`/`reportError()` in the main driver (llvm-objcopy.cpp) as well as the associated argv-parsing (CopyConfig.cpp). `logAllUnhandledErrors()` is now the main way to print errors. There are still a few uses from within the per-arch drivers, so we can't delete them yet... but almost! Reviewers: jhenderson, alexshap, espindola Reviewed By: jhenderson Subscribers: emaste, arichardson, jakehehrlich, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58316 llvm-svn: 354600
* [llvm-objcopy] Move elf-specific tests into subfolderAlexander Shaposhnikov2018-11-301-0/+10
In this diff the elf-specific tests are moved into the subfolder llvm-objcopy/ELF (the change was discussed in the comments on https://reviews.llvm.org/D54674). A separate code reivew wasn't sent for this change since Phabricator is failing to create such a large diff. Test plan: make check-all make check-llvm-tools make check-llvm-tools-llvm-objcopy llvm-svn: 347958
OpenPOWER on IntegriCloud