diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-04-30 15:40:54 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-04-30 15:40:54 +0000 |
commit | e87dadc44b1544c35e13cf48dfe167109929a944 (patch) | |
tree | b5142993e8acc356f130f2e58f4ae1aefdbd8d17 /lib/Object | |
parent | 1872730c5a0d95ba9d2ed7e1e9607e86c50e9070 (diff) |
Fix Addend computation for non external relocations on Macho.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180790 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object')
-rw-r--r-- | lib/Object/MachOObjectFile.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Object/MachOObjectFile.cpp b/lib/Object/MachOObjectFile.cpp index f6840b8c15..dfd8d3d3dd 100644 --- a/lib/Object/MachOObjectFile.cpp +++ b/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; |