diff options
author | George Rimar <grimar@accesssoftek.com> | 2019-07-29 07:58:29 +0000 |
---|---|---|
committer | George Rimar <grimar@accesssoftek.com> | 2019-07-29 07:58:29 +0000 |
commit | aef03e86c1c6cadbbb2e7fdd1a2947f7e7cc5961 (patch) | |
tree | 6dc064301f97cbdbf5f1adbb893cef5a05e762ef /llvm/tools/obj2yaml/elf2yaml.cpp | |
parent | 99f73ebe5c96de340c3a148c4a99e4aca5d13b7a (diff) | |
download | bcm5719-llvm-aef03e86c1c6cadbbb2e7fdd1a2947f7e7cc5961.tar.gz bcm5719-llvm-aef03e86c1c6cadbbb2e7fdd1a2947f7e7cc5961.zip |
[obj2yaml] - Report a error when unable to resolve a sh_link reference properly.
Because of a bug we did not report a error in the case
shown in the test. With this patch we do.
Differential revision: https://reviews.llvm.org/D65214
llvm-svn: 367203
Diffstat (limited to 'llvm/tools/obj2yaml/elf2yaml.cpp')
-rw-r--r-- | llvm/tools/obj2yaml/elf2yaml.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/tools/obj2yaml/elf2yaml.cpp b/llvm/tools/obj2yaml/elf2yaml.cpp index bd27c103403..dea3cf73a5d 100644 --- a/llvm/tools/obj2yaml/elf2yaml.cpp +++ b/llvm/tools/obj2yaml/elf2yaml.cpp @@ -376,8 +376,12 @@ Error ELFDumper<ELFT>::dumpCommonSection(const Elf_Shdr *Shdr, if (Shdr->sh_link != ELF::SHN_UNDEF) { auto LinkSection = Obj.getSection(Shdr->sh_link); - if (LinkSection.takeError()) - return LinkSection.takeError(); + if (!LinkSection) + return make_error<StringError>( + "unable to resolve sh_link reference in section '" + S.Name + + "': " + toString(LinkSection.takeError()), + inconvertibleErrorCode()); + NameOrErr = getUniquedSectionName(*LinkSection); if (!NameOrErr) return NameOrErr.takeError(); |