Don't pass a member variable to a method. NFC.

llvm-svn: 252718
This commit is contained in:
Rafael Espindola 2015-11-11 10:23:32 +00:00
parent 9a6e4632a0
commit 8e37f791f7
2 changed files with 7 additions and 10 deletions

View File

@ -84,8 +84,7 @@ template <class ELFT>
template <bool isRela>
void InputSectionBase<ELFT>::relocate(
uint8_t *Buf, uint8_t *BufEnd,
iterator_range<const Elf_Rel_Impl<ELFT, isRela> *> Rels,
const ObjectFile<ELFT> &File, uintX_t BaseAddr) {
iterator_range<const Elf_Rel_Impl<ELFT, isRela> *> Rels, uintX_t BaseAddr) {
typedef Elf_Rel_Impl<ELFT, isRela> RelType;
for (const RelType &RI : Rels) {
uint32_t SymIndex = RI.getSymbol(Config->Mips64EL);
@ -103,14 +102,14 @@ void InputSectionBase<ELFT>::relocate(
// Handle relocations for local symbols -- they never get
// resolved so we don't allocate a SymbolBody.
const Elf_Shdr *SymTab = File.getSymbolTable();
const Elf_Shdr *SymTab = File->getSymbolTable();
if (SymIndex < SymTab->sh_info) {
uintX_t SymVA = getLocalRelTarget(File, RI);
uintX_t SymVA = getLocalRelTarget(*File, RI);
Target->relocateOne(BufLoc, BufEnd, Type, AddrLoc, SymVA);
continue;
}
SymbolBody &Body = *File.getSymbolBody(SymIndex)->repl();
SymbolBody &Body = *File->getSymbolBody(SymIndex)->repl();
uintX_t SymVA = getSymVA<ELFT>(Body);
if (Target->relocNeedsPlt(Type, Body)) {
SymVA = Out<ELFT>::Plt->getEntryAddr(Body);
@ -143,11 +142,9 @@ template <class ELFT> void InputSection<ELFT>::writeTo(uint8_t *Buf) {
// Iterate over all relocation sections that apply to this section.
for (const Elf_Shdr *RelSec : RelocSections) {
if (RelSec->sh_type == SHT_RELA)
this->relocate(Base, Base + Data.size(), EObj.relas(RelSec), *this->File,
BaseAddr);
this->relocate(Base, Base + Data.size(), EObj.relas(RelSec), BaseAddr);
else
this->relocate(Base, Base + Data.size(), EObj.rels(RelSec), *this->File,
BaseAddr);
this->relocate(Base, Base + Data.size(), EObj.rels(RelSec), BaseAddr);
}
}

View File

@ -74,7 +74,7 @@ public:
void relocate(uint8_t *Buf, uint8_t *BufEnd,
llvm::iterator_range<
const llvm::object::Elf_Rel_Impl<ELFT, isRela> *> Rels,
const ObjectFile<ELFT> &File, uintX_t BaseAddr);
uintX_t BaseAddr);
};
template <class ELFT>