[llvm-readobj/ELF] Simplify Verdef handling.
authorDavide Italiano <davide@freebsd.org>
Fri, 4 Dec 2015 19:27:58 +0000 (19:27 +0000)
committerDavide Italiano <davide@freebsd.org>
Fri, 4 Dec 2015 19:27:58 +0000 (19:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254751 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-readobj/ELFDumper.cpp

index ef07a85..02397f3 100644 (file)
@@ -433,17 +433,11 @@ StringRef ELFDumper<ELFT>::getSymbolVersion(StringRef StrTab,
   if (entry.isVerdef()) {
     // The first Verdaux entry holds the name.
     name_offset = entry.getVerdef()->getAux()->vda_name;
-  } else {
-    name_offset = entry.getVernaux()->vna_name;
-  }
-
-  // Set IsDefault
-  if (entry.isVerdef()) {
     IsDefault = !(vs->vs_index & ELF::VERSYM_HIDDEN);
   } else {
+    name_offset = entry.getVernaux()->vna_name;
     IsDefault = false;
   }
-
   if (name_offset >= StrTab.size())
     reportError("Invalid string offset");
   return StringRef(StrTab.data() + name_offset);