summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-objcopy/ELF/binary-output-empty.test
Commit message (Collapse)AuthorAgeFilesLines
* [llvm-objcopy] Fix crash when writing empty binary outputJordan Rupprecht2019-01-281-0/+27
Summary: When using llvm-objcopy -O binary and the resulting file will be empty (e.g. removing the only section that would be written, or using --only-keep with a section that doesn't exist/isn't SHF_ALLOC), we crash because FileOutputBuffer expects Size > 0. Add a regression test, and change Buffer to open/truncate the output file in this case. Reviewers: alexshap, jhenderson, jakehehrlich, espindola Reviewed By: alexshap, jhenderson Subscribers: jfb, llvm-commits, emaste, arichardson Differential Revision: https://reviews.llvm.org/D56806 llvm-svn: 352371
OpenPOWER on IntegriCloud