[ELF] - Detemplate SymbolBody::getGotOffset(). NFC.

llvm-svn: 298091
This commit is contained in:
George Rimar 2017-03-17 14:12:51 +00:00
parent 284b97c6bc
commit 4afe42e5c4
4 changed files with 9 additions and 15 deletions

View File

@ -356,7 +356,7 @@ getRelocTargetVA(uint32_t Type, int64_t A, typename ELFT::uint P,
return Body.getVA(A) - In<ELFT>::Got->getVA() - In<ELFT>::Got->getSize();
case R_RELAX_TLS_GD_TO_IE_END:
case R_GOT_FROM_END:
return Body.getGotOffset<ELFT>() + A - In<ELFT>::Got->getSize();
return Body.getGotOffset() + A - In<ELFT>::Got->getSize();
case R_RELAX_TLS_GD_TO_IE_ABS:
case R_GOT:
return Body.getGotVA<ELFT>() + A;
@ -392,7 +392,7 @@ getRelocTargetVA(uint32_t Type, int64_t A, typename ELFT::uint P,
case R_RELAX_GOT_PC_NOPIC:
return Body.getVA(A);
case R_GOT_OFF:
return Body.getGotOffset<ELFT>() + A;
return Body.getGotOffset() + A;
case R_MIPS_GOT_LOCAL_PAGE:
// If relocation against MIPS local symbol requires GOT entry, this entry
// should be initialized by 'page address'. This address is high 16-bits

View File

@ -218,8 +218,7 @@ handleTlsRelocation(uint32_t Type, SymbolBody &Body, InputSectionBase &C,
if (!Body.isInGot()) {
In<ELFT>::Got->addEntry(Body);
In<ELFT>::RelaDyn->addReloc({Target->TlsGotRel, In<ELFT>::Got,
Body.getGotOffset<ELFT>(), false, &Body,
0});
Body.getGotOffset(), false, &Body, 0});
}
return Target->TlsGdRelaxSkip;
}
@ -815,8 +814,8 @@ static void scanRelocs(InputSectionBase &C, ArrayRef<RelTy> Rels) {
// ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf
In<ELFT>::MipsGot->addEntry(Body, Addend, Expr);
if (Body.isTls() && Body.isPreemptible())
AddDyn({Target->TlsGotRel, In<ELFT>::MipsGot,
Body.getGotOffset<ELFT>(), false, &Body, 0});
AddDyn({Target->TlsGotRel, In<ELFT>::MipsGot, Body.getGotOffset(),
false, &Body, 0});
continue;
}
@ -824,7 +823,7 @@ static void scanRelocs(InputSectionBase &C, ArrayRef<RelTy> Rels) {
continue;
In<ELFT>::Got->addEntry(Body);
uintX_t Off = Body.getGotOffset<ELFT>();
uintX_t Off = Body.getGotOffset();
uint32_t DynType;
RelExpr GotRE = R_ABS;
if (Body.isTls()) {

View File

@ -163,10 +163,10 @@ uint64_t SymbolBody::getVA(int64_t Addend) const {
}
template <class ELFT> typename ELFT::uint SymbolBody::getGotVA() const {
return In<ELFT>::Got->getVA() + getGotOffset<ELFT>();
return In<ELFT>::Got->getVA() + getGotOffset();
}
template <class ELFT> typename ELFT::uint SymbolBody::getGotOffset() const {
uint64_t SymbolBody::getGotOffset() const {
return GotIndex * Target->GotEntrySize;
}
@ -380,11 +380,6 @@ template uint32_t SymbolBody::template getGotVA<ELF32BE>() const;
template uint64_t SymbolBody::template getGotVA<ELF64LE>() const;
template uint64_t SymbolBody::template getGotVA<ELF64BE>() const;
template uint32_t SymbolBody::template getGotOffset<ELF32LE>() const;
template uint32_t SymbolBody::template getGotOffset<ELF32BE>() const;
template uint64_t SymbolBody::template getGotOffset<ELF64LE>() const;
template uint64_t SymbolBody::template getGotOffset<ELF64BE>() const;
template uint32_t SymbolBody::template getSize<ELF32LE>() const;
template uint32_t SymbolBody::template getSize<ELF32BE>() const;
template uint64_t SymbolBody::template getSize<ELF64LE>() const;

View File

@ -77,7 +77,7 @@ public:
uint64_t getVA(int64_t Addend = 0) const;
template <class ELFT> typename ELFT::uint getGotOffset() const;
uint64_t getGotOffset() const;
template <class ELFT> typename ELFT::uint getGotVA() const;
uint64_t getGotPltOffset() const;
uint64_t getGotPltVA() const;