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
This commit is contained in:
Rafael Espindola
2013-04-30 15:40:54 +00:00
parent 1872730c5a
commit e87dadc44b
4 changed files with 33 additions and 28 deletions

View File

@ -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;