summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/MachOObjectFile.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-04-30 15:40:54 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-04-30 15:40:54 +0000
commit52501033d0935fd221c7278ccee478192a435d8d (patch)
treed0b0e3c1e24cb2b9529385a626d07ec048d31af6 /llvm/lib/Object/MachOObjectFile.cpp
parent27d807cc9cdf17d88339afd7ee7b7a6d31717dbb (diff)
downloadbcm5719-llvm-52501033d0935fd221c7278ccee478192a435d8d.tar.gz
bcm5719-llvm-52501033d0935fd221c7278ccee478192a435d8d.zip
Fix Addend computation for non external relocations on Macho.
llvm-svn: 180790
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r--llvm/lib/Object/MachOObjectFile.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp
index f6840b8c15d..dfd8d3d3dd1 100644
--- a/llvm/lib/Object/MachOObjectFile.cpp
+++ b/llvm/lib/Object/MachOObjectFile.cpp
@@ -1414,6 +1414,16 @@ MachOObjectFile::getAnyRelocationType(const macho::RelocationEntry &RE) const {
return getPlainRelocationType(this, RE);
}
+SectionRef
+MachOObjectFile::getRelocationSection(const macho::RelocationEntry &RE) const {
+ if (isRelocationScattered(RE) || getPlainRelocationExternal(RE))
+ return *end_sections();
+ unsigned SecNum = getPlainRelocationSymbolNum(RE) - 1;
+ DataRefImpl DRI;
+ DRI.d.a = SecNum;
+ return SectionRef(DRI, this);
+}
+
MachOObjectFile::LoadCommandInfo
MachOObjectFile::getFirstLoadCommandInfo() const {
MachOObjectFile::LoadCommandInfo Load;
OpenPOWER on IntegriCloud