summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/MachOObjectFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r--llvm/lib/Object/MachOObjectFile.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp
index 54e4624af13..3c82d7bf3e2 100644
--- a/llvm/lib/Object/MachOObjectFile.cpp
+++ b/llvm/lib/Object/MachOObjectFile.cpp
@@ -369,11 +369,10 @@ std::error_code MachOObjectFile::getIndirectName(DataRefImpl Symb,
}
uint64_t MachOObjectFile::getSymbolValue(DataRefImpl Sym) const {
- uint64_t NValue = getNValue(Sym);
MachO::nlist_base Entry = getSymbolTableEntryBase(this, Sym);
- if ((Entry.n_type & MachO::N_TYPE) == MachO::N_UNDF && NValue == 0)
+ if ((Entry.n_type & MachO::N_TYPE) == MachO::N_UNDF)
return UnknownAddress;
- return NValue;
+ return getNValue(Sym);
}
ErrorOr<uint64_t> MachOObjectFile::getSymbolAddress(DataRefImpl Sym) const {
OpenPOWER on IntegriCloud