diff options
| -rw-r--r-- | lld/ELF/InputSection.cpp | 10 | ||||
| -rw-r--r-- | lld/ELF/OutputSections.h | 1 |
2 files changed, 3 insertions, 8 deletions
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index 774d3f0f2dd..f3491410f25 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -190,14 +190,11 @@ template <class ELFT> static typename ELFT::uint getSymVA(uint32_t Type, typename ELFT::uint A, typename ELFT::uint P, const SymbolBody &Body, RelExpr Expr) { - typedef typename ELFT::uint uintX_t; - switch (Expr) { case R_HINT: llvm_unreachable("cannot relocate hint relocs"); case R_TLSLD: - return Out<ELFT>::Got->getTlsIndexOff() + A - - Out<ELFT>::Got->getNumEntries() * sizeof(uintX_t); + return Out<ELFT>::Got->getTlsIndexOff() + A - Out<ELFT>::Got->getSize(); case R_TLSLD_PC: return Out<ELFT>::Got->getTlsIndexVA() + A - P; case R_THUNK_ABS: @@ -209,7 +206,7 @@ static typename ELFT::uint getSymVA(uint32_t Type, typename ELFT::uint A, return getPPC64TocBase() + A; case R_TLSGD: return Out<ELFT>::Got->getGlobalDynOffset(Body) + A - - Out<ELFT>::Got->getNumEntries() * sizeof(uintX_t); + Out<ELFT>::Got->getSize(); case R_TLSGD_PC: return Out<ELFT>::Got->getGlobalDynAddr(Body) + A - P; case R_TLSDESC: @@ -228,8 +225,7 @@ static typename ELFT::uint getSymVA(uint32_t Type, typename ELFT::uint A, return Body.getVA<ELFT>(A) - Out<ELFT>::Got->getVA(); case R_RELAX_TLS_GD_TO_IE_END: case R_GOT_FROM_END: - return Body.getGotOffset<ELFT>() + A - - Out<ELFT>::Got->getNumEntries() * sizeof(uintX_t); + return Body.getGotOffset<ELFT>() + A - Out<ELFT>::Got->getSize(); case R_RELAX_TLS_GD_TO_IE_ABS: case R_GOT: return Body.getGotVA<ELFT>() + A; diff --git a/lld/ELF/OutputSections.h b/lld/ELF/OutputSections.h index b350bef1afb..2619e98bcfd 100644 --- a/lld/ELF/OutputSections.h +++ b/lld/ELF/OutputSections.h @@ -135,7 +135,6 @@ public: uintX_t getMipsGotOffset(const SymbolBody &B, uintX_t Addend) const; uintX_t getGlobalDynAddr(const SymbolBody &B) const; uintX_t getGlobalDynOffset(const SymbolBody &B) const; - uintX_t getNumEntries() const { return Entries.size(); } typename Base::Kind getKind() const override { return Base::Got; } static bool classof(const Base *B) { return B->getKind() == Base::Got; } |

