[uselistorder] Insert blank line, NFC
[oota-llvm.git] / tools / yaml2obj / yaml2elf.cpp
index 4940e837367a287ef8e15dfb5d5ef19f0f43ef1a..849f202b126a5e73521ecc5f0ecc2091270a50ff 100644 (file)
@@ -222,9 +222,11 @@ bool ELFState<ELFT>::initSectionHeaders(std::vector<Elf_Shdr> &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;
 
@@ -267,6 +269,7 @@ void ELFState<ELFT>::initSymtabSectionHeader(Elf_Shdr &SHeader,
   // One greater than symbol table index of the last local symbol.
   SHeader.sh_info = Doc.Symbols.Local.size() + 1;
   SHeader.sh_entsize = sizeof(Elf_Sym);
+  SHeader.sh_addralign = 8;
 
   std::vector<Elf_Sym> Syms;
   {