Skip to content

Commit 09a77fe

Browse files
committedMar 29, 2019
[llvm-readobj] Change variable names to match LLVM-style. NFC.
Summary: This patch helps change variable names to match LLVM-style Reviewers: jhenderson, Higuoxing Reviewed By: Higuoxing Subscribers: rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59931 llvm-svn: 357230
1 parent 8b8d362 commit 09a77fe

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed
 

‎llvm/tools/llvm-readobj/ELFDumper.cpp

+19-19
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,9 @@ class ELFDumper : public ObjDumper {
228228
StringRef DynSymtabName;
229229
ArrayRef<Elf_Word> ShndxTable;
230230

231-
const Elf_Shdr *dot_gnu_version_sec = nullptr; // .gnu.version
232-
const Elf_Shdr *dot_gnu_version_r_sec = nullptr; // .gnu.version_r
233-
const Elf_Shdr *dot_gnu_version_d_sec = nullptr; // .gnu.version_d
231+
const Elf_Shdr *SymbolVersionSection = nullptr; // .gnu.version
232+
const Elf_Shdr *SymbolVersionNeedSection = nullptr; // .gnu.version_r
233+
const Elf_Shdr *SymbolVersionDefSection = nullptr; // .gnu.version_d
234234

235235
// Records for each version index the corresponding Verdef or Vernaux entry.
236236
// This is filled the first time LoadVersionMap() is called.
@@ -609,7 +609,7 @@ void ELFDumper<ELFT>::LoadVersionDefs(const Elf_Shdr *sec) const {
609609

610610
template <class ELFT> void ELFDumper<ELFT>::LoadVersionMap() const {
611611
// If there is no dynamic symtab or version table, there is nothing to do.
612-
if (!DynSymRegion.Addr || !dot_gnu_version_sec)
612+
if (!DynSymRegion.Addr || !SymbolVersionSection)
613613
return;
614614

615615
// Has the VersionMap already been loaded?
@@ -621,19 +621,19 @@ template <class ELFT> void ELFDumper<ELFT>::LoadVersionMap() const {
621621
VersionMap.push_back(VersionMapEntry());
622622
VersionMap.push_back(VersionMapEntry());
623623

624-
if (dot_gnu_version_d_sec)
625-
LoadVersionDefs(dot_gnu_version_d_sec);
624+
if (SymbolVersionDefSection)
625+
LoadVersionDefs(SymbolVersionDefSection);
626626

627-
if (dot_gnu_version_r_sec)
628-
LoadVersionNeeds(dot_gnu_version_r_sec);
627+
if (SymbolVersionNeedSection)
628+
LoadVersionNeeds(SymbolVersionNeedSection);
629629
}
630630

631631
template <typename ELFT>
632632
StringRef ELFDumper<ELFT>::getSymbolVersion(StringRef StrTab,
633633
const Elf_Sym *Sym,
634634
bool &IsDefault) const {
635635
// This is a dynamic symbol. Look in the GNU symbol version table.
636-
if (!dot_gnu_version_sec) {
636+
if (!SymbolVersionSection) {
637637
// No version table.
638638
IsDefault = false;
639639
return "";
@@ -647,7 +647,7 @@ StringRef ELFDumper<ELFT>::getSymbolVersion(StringRef StrTab,
647647
// Get the corresponding version index entry.
648648
const Elf_Versym *Versym =
649649
unwrapOrError(ObjF->getELFFile()->template getEntry<Elf_Versym>(
650-
dot_gnu_version_sec, EntryIndex));
650+
SymbolVersionSection, EntryIndex));
651651
return this->getSymbolVersionByIndex(StrTab, Versym->vs_index, IsDefault);
652652
}
653653

@@ -1351,19 +1351,19 @@ ELFDumper<ELFT>::ELFDumper(const object::ELFObjectFile<ELFT> *ObjF,
13511351
ShndxTable = unwrapOrError(Obj->getSHNDXTable(Sec));
13521352
break;
13531353
case ELF::SHT_GNU_versym:
1354-
if (dot_gnu_version_sec != nullptr)
1354+
if (SymbolVersionSection != nullptr)
13551355
reportError("Multiple SHT_GNU_versym");
1356-
dot_gnu_version_sec = &Sec;
1356+
SymbolVersionSection = &Sec;
13571357
break;
13581358
case ELF::SHT_GNU_verdef:
1359-
if (dot_gnu_version_d_sec != nullptr)
1359+
if (SymbolVersionDefSection != nullptr)
13601360
reportError("Multiple SHT_GNU_verdef");
1361-
dot_gnu_version_d_sec = &Sec;
1361+
SymbolVersionDefSection = &Sec;
13621362
break;
13631363
case ELF::SHT_GNU_verneed:
1364-
if (dot_gnu_version_r_sec != nullptr)
1364+
if (SymbolVersionNeedSection != nullptr)
13651365
reportError("Multiple SHT_GNU_verneed");
1366-
dot_gnu_version_r_sec = &Sec;
1366+
SymbolVersionNeedSection = &Sec;
13671367
break;
13681368
case ELF::SHT_LLVM_CALL_GRAPH_PROFILE:
13691369
if (DotCGProfileSec != nullptr)
@@ -1515,15 +1515,15 @@ void ELFDumper<ELFT>::printProgramHeaders(
15151515
template <typename ELFT> void ELFDumper<ELFT>::printVersionInfo() {
15161516
// Dump version symbol section.
15171517
ELFDumperStyle->printVersionSymbolSection(ObjF->getELFFile(),
1518-
dot_gnu_version_sec);
1518+
SymbolVersionSection);
15191519

15201520
// Dump version definition section.
15211521
ELFDumperStyle->printVersionDefinitionSection(ObjF->getELFFile(),
1522-
dot_gnu_version_d_sec);
1522+
SymbolVersionDefSection);
15231523

15241524
// Dump version dependency section.
15251525
ELFDumperStyle->printVersionDependencySection(ObjF->getELFFile(),
1526-
dot_gnu_version_r_sec);
1526+
SymbolVersionNeedSection);
15271527
}
15281528

15291529
template <class ELFT> void ELFDumper<ELFT>::printDynamicRelocations() {

0 commit comments

Comments
 (0)
Please sign in to comment.