aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-objdump/llvm-objdump.cpp
diff options
context:
space:
mode:
authorJordan Rupprecht <rupprecht@google.com>2019-01-28 15:02:40 +0000
committerJordan Rupprecht <rupprecht@google.com>2019-01-28 15:02:40 +0000
commitb2702d6a45016b24bed936901c183a5b1851858a (patch)
treeac94a272963be35296887161473b2821f3d0534a /llvm/tools/llvm-objdump/llvm-objdump.cpp
parent6c5dfcb89edf93eb50356dc39ea0ea2dcbba906f (diff)
downloadllvm-b2702d6a45016b24bed936901c183a5b1851858a.zip
llvm-b2702d6a45016b24bed936901c183a5b1851858a.tar.gz
llvm-b2702d6a45016b24bed936901c183a5b1851858a.tar.bz2
[llvm-objcopy] Fix crash when writing empty binary output
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
Diffstat (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp')
0 files changed, 0 insertions, 0 deletions