summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/obj2yaml/elf2yaml.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/tools/obj2yaml/elf2yaml.cpp b/llvm/tools/obj2yaml/elf2yaml.cpp
index 8997a5c4211..8c94843788f 100644
--- a/llvm/tools/obj2yaml/elf2yaml.cpp
+++ b/llvm/tools/obj2yaml/elf2yaml.cpp
@@ -188,6 +188,8 @@ template <class ELFT> ErrorOr<ELFYAML::Object *> ELFDumper<ELFT>::dump() {
}
// Dump symbols
+ if (!Symtab)
+ return Y.release(); // if the symbol table is missing return early
auto StrTableOrErr = Obj.getStringTableForSymtab(*Symtab);
if (!StrTableOrErr)
return errorToErrorCode(StrTableOrErr.takeError());
OpenPOWER on IntegriCloud