aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2016-06-08 11:40:24 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2016-06-08 11:40:24 +0000
commit4e0d89dcf031a4c55755814e8e6a54a687f349ee (patch)
tree50884107579a121555324071818b0d4f0b995745
parenta3c48da01568fbfcabcb757cb2b261ccb7e5688f (diff)
[ELF] - Replaced hardcode with named constants. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@272129 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--ELF/InputFiles.cpp3
-rw-r--r--ELF/OutputSections.cpp3
2 files changed, 3 insertions, 3 deletions
diff --git a/ELF/InputFiles.cpp b/ELF/InputFiles.cpp
index 19109bfa6..b61f37944 100644
--- a/ELF/InputFiles.cpp
+++ b/ELF/InputFiles.cpp
@@ -532,7 +532,8 @@ template <class ELFT> void SharedFile<ELFT>::parseRest() {
if (Versym) {
// Ignore local symbols and non-default versions.
- if (VersymIndex == 0 || VersymIndex == 1 || (VersymIndex & VERSYM_HIDDEN))
+ if (VersymIndex == VER_NDX_LOCAL || VersymIndex == VER_NDX_GLOBAL ||
+ (VersymIndex & VERSYM_HIDDEN))
continue;
}
elf::Symtab<ELFT>::X->addShared(this, Name, Sym, Verdefs[VersymIndex]);
diff --git a/ELF/OutputSections.cpp b/ELF/OutputSections.cpp
index 96808d34e..bba6b96d1 100644
--- a/ELF/OutputSections.cpp
+++ b/ELF/OutputSections.cpp
@@ -1430,8 +1430,7 @@ template <class ELFT> void VersionTableSection<ELFT>::writeTo(uint8_t *Buf) {
if (auto *SS = dyn_cast<SharedSymbol<ELFT>>(P.first))
OutVersym->vs_index = SS->VersionId;
else
- // The reserved identifier for a non-versioned global symbol.
- OutVersym->vs_index = 1;
+ OutVersym->vs_index = VER_NDX_GLOBAL;
++OutVersym;
}
}