Be sure to always increment the Versym pointer.

It was getting out of sync if we had undefined symbols at the start of
the symbol table.

llvm-svn: 268077
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index a4b5b71..2c7124e 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -490,16 +490,19 @@
   uint32_t NumSymbols = std::distance(Syms.begin(), Syms.end());
   SymbolBodies.reserve(NumSymbols);
   for (const Elf_Sym &Sym : Syms) {
+    unsigned VersymIndex = 0;
+    if (Versym) {
+      VersymIndex = Versym->vs_index;
+      ++Versym;
+    }
+
     StringRef Name = check(Sym.getName(this->StringTable));
     if (Sym.isUndefined()) {
       Undefs.push_back(Name);
       continue;
     }
 
-    unsigned VersymIndex = 0;
     if (Versym) {
-      VersymIndex = Versym->vs_index;
-      ++Versym;
       // Ignore local symbols and non-default versions.
       if (VersymIndex == 0 || (VersymIndex & VERSYM_HIDDEN))
         continue;