summaryrefslogtreecommitdiffstats
path: root/llvm/tools/obj2yaml/elf2yaml.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/obj2yaml/elf2yaml.cpp')
-rw-r--r--llvm/tools/obj2yaml/elf2yaml.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/tools/obj2yaml/elf2yaml.cpp b/llvm/tools/obj2yaml/elf2yaml.cpp
index eee09369dc9..eff743604d7 100644
--- a/llvm/tools/obj2yaml/elf2yaml.cpp
+++ b/llvm/tools/obj2yaml/elf2yaml.cpp
@@ -438,10 +438,10 @@ ELFDumper<ELFT>::dumpContentSection(const Elf_Shdr *Shdr) {
auto ContentOrErr = Obj.getSectionContents(Shdr);
if (!ContentOrErr)
return errorToErrorCode(ContentOrErr.takeError());
- S->Content = yaml::BinaryRef(ContentOrErr.get());
- S->Size = S->Content.binary_size();
+ ArrayRef<uint8_t> Content = *ContentOrErr;
+ if (!Content.empty())
+ S->Content = yaml::BinaryRef(Content);
S->Info = Shdr->sh_info;
-
return S.release();
}
OpenPOWER on IntegriCloud