From 78bdd69848144b7a6663a74e841e3d607ad0aab3 Mon Sep 17 00:00:00 2001 From: "Michael J. Spencer" Date: Thu, 27 Aug 2015 23:11:20 +0000 Subject: [PATCH] [yaml2obj] Support numeric indexes to create invalid files. Will be used by lld test. llvm-svn: 246233 --- tools/yaml2obj/yaml2elf.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/yaml2obj/yaml2elf.cpp b/tools/yaml2obj/yaml2elf.cpp index a247f48c053..849f202b126 100644 --- a/tools/yaml2obj/yaml2elf.cpp +++ b/tools/yaml2obj/yaml2elf.cpp @@ -222,9 +222,11 @@ bool ELFState::initSectionHeaders(std::vector &SHeaders, unsigned Index; if (SN2I.lookup(S->Info, Index)) { - errs() << "error: Unknown section referenced: '" << S->Info - << "' at YAML section '" << S->Name << "'.\n"; - return false; + if (S->Info.getAsInteger(0, Index)) { + errs() << "error: Unknown section referenced: '" << S->Info + << "' at YAML section '" << S->Name << "'.\n"; + return false; + } } SHeader.sh_info = Index;