[ELF2] Remove unneeded new Type parameter

As pointed out by Rafael (with a further suggestion by Rui), the new Type
parameter I added in r250555 is not needed. Remove it.

llvm-svn: 250563
This commit is contained in:
Hal Finkel 2015-10-16 22:37:32 +00:00
parent 4da5de9c34
commit 230c5c5b52
3 changed files with 9 additions and 11 deletions

View File

@ -57,7 +57,7 @@ void InputSection<ELFT>::relocate(
// resolved so we don't allocate a SymbolBody.
const Elf_Shdr *SymTab = File.getSymbolTable();
if (SymIndex < SymTab->sh_info) {
uintX_t SymVA = getLocalRelTarget(File, RI, Type);
uintX_t SymVA = getLocalRelTarget(File, RI);
relocateOne(Buf, BufEnd, RI, Type, BaseAddr, SymVA);
continue;
}

View File

@ -126,7 +126,7 @@ template <class ELFT> void RelocationSection<ELFT>::writeTo(uint8_t *Buf) {
if (Body)
Addend += getSymVA<ELFT>(cast<ELFSymbolBody<ELFT>>(*Body));
else
Addend += getLocalRelTarget(File, RI, Type);
Addend += getLocalRelTarget(File, RI);
}
P->setSymbolAndType(0, Target->getRelativeReloc(), IsMips64EL);
}
@ -424,11 +424,10 @@ typename ELFFile<ELFT>::uintX_t lld::elf2::getSymVA(const SymbolBody &S) {
template <class ELFT>
typename ELFFile<ELFT>::uintX_t
lld::elf2::getLocalRelTarget(const ObjectFile<ELFT> &File,
const typename ELFFile<ELFT>::Elf_Rel &RI,
uint32_t Type) {
const typename ELFFile<ELFT>::Elf_Rel &RI) {
// PPC64 has a special relocation representing the TOC base pointer
// that does not have a corresponding symbol.
if (Config->EMachine == EM_PPC64 && Type == R_PPC64_TOC)
if (Config->EMachine == EM_PPC64 && RI.getType(false) == R_PPC64_TOC)
return getPPC64TocBase();
typedef typename ELFFile<ELFT>::Elf_Sym Elf_Sym;
@ -750,19 +749,19 @@ template ELFFile<ELF64BE>::uintX_t getSymVA<ELF64BE>(const SymbolBody &);
template ELFFile<ELF32LE>::uintX_t
getLocalRelTarget(const ObjectFile<ELF32LE> &,
const ELFFile<ELF32LE>::Elf_Rel &, uint32_t);
const ELFFile<ELF32LE>::Elf_Rel &);
template ELFFile<ELF32BE>::uintX_t
getLocalRelTarget(const ObjectFile<ELF32BE> &,
const ELFFile<ELF32BE>::Elf_Rel &, uint32_t);
const ELFFile<ELF32BE>::Elf_Rel &);
template ELFFile<ELF64LE>::uintX_t
getLocalRelTarget(const ObjectFile<ELF64LE> &,
const ELFFile<ELF64LE>::Elf_Rel &, uint32_t);
const ELFFile<ELF64LE>::Elf_Rel &);
template ELFFile<ELF64BE>::uintX_t
getLocalRelTarget(const ObjectFile<ELF64BE> &,
const ELFFile<ELF64BE>::Elf_Rel &, uint32_t);
const ELFFile<ELF64BE>::Elf_Rel &);
template bool includeInSymtab<ELF32LE>(const SymbolBody &);
template bool includeInSymtab<ELF32BE>(const SymbolBody &);

View File

@ -38,8 +38,7 @@ typename llvm::object::ELFFile<ELFT>::uintX_t getSymVA(const SymbolBody &S);
template <class ELFT>
typename llvm::object::ELFFile<ELFT>::uintX_t
getLocalRelTarget(const ObjectFile<ELFT> &File,
const typename llvm::object::ELFFile<ELFT>::Elf_Rel &Sym,
uint32_t Type);
const typename llvm::object::ELFFile<ELFT>::Elf_Rel &Sym);
bool canBePreempted(const SymbolBody *Body, bool NeedsGot);
template <class ELFT> bool includeInSymtab(const SymbolBody &B);