aboutsummaryrefslogtreecommitdiff
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.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp
index d33a64f..cb98f05 100644
--- a/llvm/lib/Object/MachOObjectFile.cpp
+++ b/llvm/lib/Object/MachOObjectFile.cpp
@@ -370,14 +370,17 @@ std::error_code MachOObjectFile::getIndirectName(DataRefImpl Symb,
return std::error_code();
}
-std::error_code MachOObjectFile::getSymbolAddress(DataRefImpl Symb,
- uint64_t &Res) const {
- uint64_t NValue = getNValue(Symb);
- MachO::nlist_base Entry = getSymbolTableEntryBase(this, 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)
- Res = UnknownAddress;
- else
- Res = NValue;
+ return UnknownAddress;
+ return NValue;
+}
+
+std::error_code MachOObjectFile::getSymbolAddress(DataRefImpl Sym,
+ uint64_t &Res) const {
+ Res = getSymbolValue(Sym);
return std::error_code();
}