diff options
author | Georgii Rymar <grimar@accesssoftek.com> | 2020-11-09 11:50:50 +0300 |
---|---|---|
committer | Georgii Rymar <grimar@accesssoftek.com> | 2020-11-09 11:50:50 +0300 |
commit | f59216b58f3379ba3885a61018cff51578a1fb21 (patch) | |
tree | d48a5cd8e28262c38c96d7df87658df920f064d3 /llvm/lib/Object/Binary.cpp | |
parent | ea8a0b8b29eb08d3f0f6ac40942a2d8e98ab57ee (diff) | |
download | llvm-f59216b58f3379ba3885a61018cff51578a1fb21.zip llvm-f59216b58f3379ba3885a61018cff51578a1fb21.tar.gz llvm-f59216b58f3379ba3885a61018cff51578a1fb21.tar.bz2 |
Revert "[llvm-readelf/obj] - Allow dumping of ELF header even if some elements are corrupt."
This reverts commit ea8a0b8b29eb08d3f0f6ac40942a2d8e98ab57ee.
It broke BBots.
http://lab.llvm.org:8011/#/builders/14/builds/1439
http://lab.llvm.org:8011/#/builders/112/builds/913
Diffstat (limited to 'llvm/lib/Object/Binary.cpp')
-rw-r--r-- | llvm/lib/Object/Binary.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/Object/Binary.cpp b/llvm/lib/Object/Binary.cpp index e741cbb..384df4b 100644 --- a/llvm/lib/Object/Binary.cpp +++ b/llvm/lib/Object/Binary.cpp @@ -44,8 +44,7 @@ StringRef Binary::getFileName() const { return Data.getBufferIdentifier(); } MemoryBufferRef Binary::getMemoryBufferRef() const { return Data; } Expected<std::unique_ptr<Binary>> object::createBinary(MemoryBufferRef Buffer, - LLVMContext *Context, - bool InitContent) { + LLVMContext *Context) { file_magic Type = identify_magic(Buffer.getBuffer()); switch (Type) { @@ -74,7 +73,7 @@ Expected<std::unique_ptr<Binary>> object::createBinary(MemoryBufferRef Buffer, case file_magic::xcoff_object_32: case file_magic::xcoff_object_64: case file_magic::wasm_object: - return ObjectFile::createSymbolicFile(Buffer, Type, Context, InitContent); + return ObjectFile::createSymbolicFile(Buffer, Type, Context); case file_magic::macho_universal_binary: return MachOUniversalBinary::create(Buffer); case file_magic::windows_resource: @@ -94,8 +93,8 @@ Expected<std::unique_ptr<Binary>> object::createBinary(MemoryBufferRef Buffer, llvm_unreachable("Unexpected Binary File Type"); } -Expected<OwningBinary<Binary>> -object::createBinary(StringRef Path, LLVMContext *Context, bool InitContent) { +Expected<OwningBinary<Binary>> object::createBinary(StringRef Path, + LLVMContext *Context) { ErrorOr<std::unique_ptr<MemoryBuffer>> FileOrErr = MemoryBuffer::getFileOrSTDIN(Path, /*FileSize=*/-1, /*RequiresNullTerminator=*/false); @@ -104,7 +103,7 @@ object::createBinary(StringRef Path, LLVMContext *Context, bool InitContent) { std::unique_ptr<MemoryBuffer> &Buffer = FileOrErr.get(); Expected<std::unique_ptr<Binary>> BinOrErr = - createBinary(Buffer->getMemBufferRef(), Context, InitContent); + createBinary(Buffer->getMemBufferRef(), Context); if (!BinOrErr) return BinOrErr.takeError(); std::unique_ptr<Binary> &Bin = BinOrErr.get(); |