Make getRelocationSection MachO only.

There are 3 types of relocations on MachO
* Scattered
* Section based
* Symbol based

On ELF and COFF relocations are symbol based.

We were in the strange situation that we abstracted over two of them. This makes
section based relocations MachO only.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240149 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2015-06-19 17:54:28 +00:00
parent 260366437c
commit 776f86420e
7 changed files with 9 additions and 39 deletions

View File

@ -991,19 +991,6 @@ symbol_iterator COFFObjectFile::getRelocationSymbol(DataRefImpl Rel) const {
return symbol_iterator(SymbolRef(Ref, this));
}
section_iterator COFFObjectFile::getRelocationSection(DataRefImpl Rel) const {
symbol_iterator Sym = getRelocationSymbol(Rel);
if (Sym == symbol_end())
return section_end();
COFFSymbolRef Symb = getCOFFSymbol(*Sym);
if (!Symb.isSection())
return section_end();
section_iterator Res(section_end());
if (getSymbolSection(Sym->getRawDataRefImpl(),Res))
return section_end();
return Res;
}
std::error_code COFFObjectFile::getRelocationType(DataRefImpl Rel,
uint64_t &Res) const {
const coff_relocation* R = toRel(Rel);