summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/MachOObjectFile.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-07-07 15:05:09 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-07-07 15:05:09 +0000
commit7e7be92c7f2d0505a3fbf33f57024f6cedeab82f (patch)
tree5bcaf77df6bf10ed129d6f429b7df336b8555067 /llvm/lib/Object/MachOObjectFile.cpp
parentcf0a80728c935b2cb68458a191d3f2cf10edcb84 (diff)
downloadbcm5719-llvm-7e7be92c7f2d0505a3fbf33f57024f6cedeab82f.tar.gz
bcm5719-llvm-7e7be92c7f2d0505a3fbf33f57024f6cedeab82f.zip
Common symbols don't have a value.
At least not in the interface exposed by ObjectFile. This matches what ELF and COFF implement. Adjust existing code that was expecting them to have values. No overall functionality change intended. Another option would be to change the interface and the ELF and COFF implementations to say that the value of a common symbol is its size. llvm-svn: 241593
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