Index: llvm/trunk/tools/llvm-readobj/ELFDumper.cpp =================================================================== --- llvm/trunk/tools/llvm-readobj/ELFDumper.cpp +++ llvm/trunk/tools/llvm-readobj/ELFDumper.cpp @@ -228,9 +228,9 @@ StringRef DynSymtabName; ArrayRef ShndxTable; - const Elf_Shdr *dot_gnu_version_sec = nullptr; // .gnu.version - const Elf_Shdr *dot_gnu_version_r_sec = nullptr; // .gnu.version_r - const Elf_Shdr *dot_gnu_version_d_sec = nullptr; // .gnu.version_d + const Elf_Shdr *SymbolVersionSection = nullptr; // .gnu.version + const Elf_Shdr *SymbolVersionNeedSection = nullptr; // .gnu.version_r + const Elf_Shdr *SymbolVersionDefSection = nullptr; // .gnu.version_d // Records for each version index the corresponding Verdef or Vernaux entry. // This is filled the first time LoadVersionMap() is called. @@ -609,7 +609,7 @@ template void ELFDumper::LoadVersionMap() const { // If there is no dynamic symtab or version table, there is nothing to do. - if (!DynSymRegion.Addr || !dot_gnu_version_sec) + if (!DynSymRegion.Addr || !SymbolVersionSection) return; // Has the VersionMap already been loaded? @@ -621,11 +621,11 @@ VersionMap.push_back(VersionMapEntry()); VersionMap.push_back(VersionMapEntry()); - if (dot_gnu_version_d_sec) - LoadVersionDefs(dot_gnu_version_d_sec); + if (SymbolVersionDefSection) + LoadVersionDefs(SymbolVersionDefSection); - if (dot_gnu_version_r_sec) - LoadVersionNeeds(dot_gnu_version_r_sec); + if (SymbolVersionNeedSection) + LoadVersionNeeds(SymbolVersionNeedSection); } template @@ -633,7 +633,7 @@ const Elf_Sym *Sym, bool &IsDefault) const { // This is a dynamic symbol. Look in the GNU symbol version table. - if (!dot_gnu_version_sec) { + if (!SymbolVersionSection) { // No version table. IsDefault = false; return ""; @@ -647,7 +647,7 @@ // Get the corresponding version index entry. const Elf_Versym *Versym = unwrapOrError(ObjF->getELFFile()->template getEntry( - dot_gnu_version_sec, EntryIndex)); + SymbolVersionSection, EntryIndex)); return this->getSymbolVersionByIndex(StrTab, Versym->vs_index, IsDefault); } @@ -1351,19 +1351,19 @@ ShndxTable = unwrapOrError(Obj->getSHNDXTable(Sec)); break; case ELF::SHT_GNU_versym: - if (dot_gnu_version_sec != nullptr) + if (SymbolVersionSection != nullptr) reportError("Multiple SHT_GNU_versym"); - dot_gnu_version_sec = &Sec; + SymbolVersionSection = &Sec; break; case ELF::SHT_GNU_verdef: - if (dot_gnu_version_d_sec != nullptr) + if (SymbolVersionDefSection != nullptr) reportError("Multiple SHT_GNU_verdef"); - dot_gnu_version_d_sec = &Sec; + SymbolVersionDefSection = &Sec; break; case ELF::SHT_GNU_verneed: - if (dot_gnu_version_r_sec != nullptr) + if (SymbolVersionNeedSection != nullptr) reportError("Multiple SHT_GNU_verneed"); - dot_gnu_version_r_sec = &Sec; + SymbolVersionNeedSection = &Sec; break; case ELF::SHT_LLVM_CALL_GRAPH_PROFILE: if (DotCGProfileSec != nullptr) @@ -1515,15 +1515,15 @@ template void ELFDumper::printVersionInfo() { // Dump version symbol section. ELFDumperStyle->printVersionSymbolSection(ObjF->getELFFile(), - dot_gnu_version_sec); + SymbolVersionSection); // Dump version definition section. ELFDumperStyle->printVersionDefinitionSection(ObjF->getELFFile(), - dot_gnu_version_d_sec); + SymbolVersionDefSection); // Dump version dependency section. ELFDumperStyle->printVersionDependencySection(ObjF->getELFFile(), - dot_gnu_version_r_sec); + SymbolVersionNeedSection); } template void ELFDumper::printDynamicRelocations() {