summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/InputSection.cpp15
-rw-r--r--lld/ELF/InputSection.h2
2 files changed, 7 insertions, 10 deletions
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp
index 0c4af1de002..a2396c6cdef 100644
--- a/lld/ELF/InputSection.cpp
+++ b/lld/ELF/InputSection.cpp
@@ -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);
}
}
diff --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h
index 97eb6e371ae..ea8681d5686 100644
--- a/lld/ELF/InputSection.h
+++ b/lld/ELF/InputSection.h
@@ -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>
OpenPOWER on IntegriCloud