[lld] r298091 - [ELF] - Detemplate SymbolBody::getGotOffset(). NFC.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 17 07:12:51 PDT 2017
Author: grimar
Date: Fri Mar 17 09:12:51 2017
New Revision: 298091
URL: http://llvm.org/viewvc/llvm-project?rev=298091&view=rev
Log:
[ELF] - Detemplate SymbolBody::getGotOffset(). NFC.
Modified:
lld/trunk/ELF/InputSection.cpp
lld/trunk/ELF/Relocations.cpp
lld/trunk/ELF/Symbols.cpp
lld/trunk/ELF/Symbols.h
Modified: lld/trunk/ELF/InputSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=298091&r1=298090&r2=298091&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Fri Mar 17 09:12:51 2017
@@ -356,7 +356,7 @@ getRelocTargetVA(uint32_t Type, int64_t
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
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
Modified: lld/trunk/ELF/Relocations.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Relocations.cpp?rev=298091&r1=298090&r2=298091&view=diff
==============================================================================
--- lld/trunk/ELF/Relocations.cpp (original)
+++ lld/trunk/ELF/Relocations.cpp Fri Mar 17 09:12:51 2017
@@ -218,8 +218,7 @@ handleTlsRelocation(uint32_t Type, Symbo
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
// 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
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()) {
Modified: lld/trunk/ELF/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.cpp?rev=298091&r1=298090&r2=298091&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.cpp (original)
+++ lld/trunk/ELF/Symbols.cpp Fri Mar 17 09:12:51 2017
@@ -163,10 +163,10 @@ uint64_t SymbolBody::getVA(int64_t Adden
}
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 g
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;
Modified: lld/trunk/ELF/Symbols.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.h?rev=298091&r1=298090&r2=298091&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.h (original)
+++ lld/trunk/ELF/Symbols.h Fri Mar 17 09:12:51 2017
@@ -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;
More information about the llvm-commits
mailing list