llvm-project/llvm/lib/Object
Shoaib Meenai ee97c5f012 [COFF] Gracefully handle empty .drectve sections
Running `llvm-readobj -coff-directives msvcrt.lib` resulted in this error:

    Invalid data was encountered while parsing the file

This happened because some of the object files in the archive have empty
`.drectve` sections. These empty sections result in a `parse_failed` error being
returned from `COFFObjectFile::getSectionContents()`, which in turn caused
`llvm-readobj` to stop. With this change, `getSectionContents` now returns
success, and like before the resulting array is empty.

Patch by Dave Lee.

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

llvm-svn: 303014
2017-05-14 18:34:56 +00:00
..
Archive.cpp [Object] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-04-19 23:02:10 +00:00
ArchiveWriter.cpp ArchiveWriter: Remove unused variables. NFC. 2017-03-16 20:35:07 +00:00
Binary.cpp [Object] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-04-19 23:02:10 +00:00
CMakeLists.txt Object: Remove ModuleSummaryIndexObjectFile class. 2017-05-01 20:42:32 +00:00
COFFObjectFile.cpp [COFF] Gracefully handle empty .drectve sections 2017-05-14 18:34:56 +00:00
Decompressor.cpp Recommit r292214 "[Support/Compression] - Change zlib API to return Error instead of custom status" 2017-01-17 15:45:07 +00:00
ELF.cpp Add llvm::object::getELFSectionTypeName(). 2017-05-02 14:04:52 +00:00
ELFObjectFile.cpp [Object] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-04-24 23:21:38 +00:00
Error.cpp Make the Error class constructor protected 2016-11-11 04:28:40 +00:00
IRObjectFile.cpp [ThinLTO] Import composite types as declarations 2016-12-16 21:25:01 +00:00
IRSymtab.cpp LTO: Mark undefined module asm symbols as used. 2017-04-26 17:53:39 +00:00
LLVMBuild.txt
MachOObjectFile.cpp [Object] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-04-21 22:03:05 +00:00
MachOUniversal.cpp Fix a bugs with using some Mach-O command line flags like "-arch armv7m". 2016-12-16 22:54:02 +00:00
ModuleSymbolTable.cpp [Object] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-04-24 23:21:38 +00:00
Object.cpp Thread Expected<...> up from libObject’s getSymbolAddress() for symbols to allow 2016-06-24 18:24:42 +00:00
ObjectFile.cpp [Object] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-04-19 23:02:10 +00:00
RecordStreamer.cpp [Object] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-04-24 23:21:38 +00:00
RecordStreamer.h [Object] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-04-24 23:21:38 +00:00
SymbolSize.cpp Fix llvm-symbolizer to correctly sort a symbol array and calculate symbol sizes 2016-11-15 21:07:03 +00:00
SymbolicFile.cpp [Object] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-04-19 23:02:10 +00:00
WasmObjectFile.cpp [WebAssembly] Improve libObject support for wasm imports and exports 2017-05-09 23:48:41 +00:00