diff options
-rw-r--r-- | lld/ELF/InputSection.cpp | 2 | ||||
-rw-r--r-- | lld/ELF/InputSection.h | 2 | ||||
-rw-r--r-- | lld/ELF/Relocations.cpp | 22 | ||||
-rw-r--r-- | lld/ELF/Relocations.h | 4 |
4 files changed, 15 insertions, 15 deletions
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index 321c880c92c..b8db080ea9a 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -346,7 +346,7 @@ void InputSectionBase<ELFT>::relocate(uint8_t *Buf, uint8_t *BufEnd) { } const unsigned Bits = sizeof(uintX_t) * 8; - for (const Relocation<ELFT> &Rel : Relocations) { + for (const Relocation &Rel : Relocations) { uintX_t Offset = getOffset(Rel.Offset); uint8_t *BufLoc = Buf + Offset; uint32_t Type = Rel.Type; diff --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h index 3b7c201446e..7529e4ec56a 100644 --- a/lld/ELF/InputSection.h +++ b/lld/ELF/InputSection.h @@ -102,7 +102,7 @@ public: void uncompress(); void relocate(uint8_t *Buf, uint8_t *BufEnd); - std::vector<Relocation<ELFT>> Relocations; + std::vector<Relocation> Relocations; }; template <class ELFT> InputSectionBase<ELFT> InputSectionBase<ELFT>::Discarded; diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp index 47c040607ca..0cd90880af2 100644 --- a/lld/ELF/Relocations.cpp +++ b/lld/ELF/Relocations.cpp @@ -97,7 +97,7 @@ handleMipsTlsRelocation(uint32_t Type, SymbolBody &Body, Out<ELFT>::RelaDyn->addReloc({Target->TlsModuleIndexRel, Out<ELFT>::Got, Out<ELFT>::Got->getTlsIndexOff(), false, nullptr, 0}); - C.Relocations.push_back({Expr, Type, &C, Offset, Addend, &Body}); + C.Relocations.push_back({Expr, Type, Offset, Addend, &Body}); return 1; } if (Target->isTlsGlobalDynamicRel(Type)) { @@ -110,7 +110,7 @@ handleMipsTlsRelocation(uint32_t Type, SymbolBody &Body, Off + (uintX_t)sizeof(uintX_t), false, &Body, 0}); } - C.Relocations.push_back({Expr, Type, &C, Offset, Addend, &Body}); + C.Relocations.push_back({Expr, Type, Offset, Addend, &Body}); return 1; } return 0; @@ -141,7 +141,7 @@ static unsigned handleTlsRelocation(uint32_t Type, SymbolBody &Body, {Target->TlsDescRel, Out<ELFT>::Got, Off, false, &Body, 0}); } if (Expr != R_HINT) - C.Relocations.push_back({Expr, Type, &C, Offset, Addend, &Body}); + C.Relocations.push_back({Expr, Type, Offset, Addend, &Body}); return 1; } @@ -149,21 +149,21 @@ static unsigned handleTlsRelocation(uint32_t Type, SymbolBody &Body, // Local-Dynamic relocs can be relaxed to Local-Exec. if (!Config->Shared) { C.Relocations.push_back( - {R_RELAX_TLS_LD_TO_LE, Type, &C, Offset, Addend, &Body}); + {R_RELAX_TLS_LD_TO_LE, Type, Offset, Addend, &Body}); return 2; } if (Out<ELFT>::Got->addTlsIndex()) Out<ELFT>::RelaDyn->addReloc({Target->TlsModuleIndexRel, Out<ELFT>::Got, Out<ELFT>::Got->getTlsIndexOff(), false, nullptr, 0}); - C.Relocations.push_back({Expr, Type, &C, Offset, Addend, &Body}); + C.Relocations.push_back({Expr, Type, Offset, Addend, &Body}); return 1; } // Local-Dynamic relocs can be relaxed to Local-Exec. if (Target->isTlsLocalDynamicRel(Type) && !Config->Shared) { C.Relocations.push_back( - {R_RELAX_TLS_LD_TO_LE, Type, &C, Offset, Addend, &Body}); + {R_RELAX_TLS_LD_TO_LE, Type, Offset, Addend, &Body}); return 1; } @@ -182,7 +182,7 @@ static unsigned handleTlsRelocation(uint32_t Type, SymbolBody &Body, Off + (uintX_t)sizeof(uintX_t), false, &Body, 0}); } - C.Relocations.push_back({Expr, Type, &C, Offset, Addend, &Body}); + C.Relocations.push_back({Expr, Type, Offset, Addend, &Body}); return 1; } @@ -191,7 +191,7 @@ static unsigned handleTlsRelocation(uint32_t Type, SymbolBody &Body, if (isPreemptible(Body, Type)) { C.Relocations.push_back( {Target->adjustRelaxExpr(Type, nullptr, R_RELAX_TLS_GD_TO_IE), Type, - &C, Offset, Addend, &Body}); + Offset, Addend, &Body}); if (!Body.isInGot()) { Out<ELFT>::Got->addEntry(Body); Out<ELFT>::RelaDyn->addReloc({Target->TlsGotRel, Out<ELFT>::Got, @@ -201,7 +201,7 @@ static unsigned handleTlsRelocation(uint32_t Type, SymbolBody &Body, return Target->TlsGdRelaxSkip; } C.Relocations.push_back( - {Target->adjustRelaxExpr(Type, nullptr, R_RELAX_TLS_GD_TO_LE), Type, &C, + {Target->adjustRelaxExpr(Type, nullptr, R_RELAX_TLS_GD_TO_LE), Type, Offset, Addend, &Body}); return Target->TlsGdRelaxSkip; } @@ -211,7 +211,7 @@ static unsigned handleTlsRelocation(uint32_t Type, SymbolBody &Body, if (Target->isTlsInitialExecRel(Type) && !Config->Shared && !isPreemptible(Body, Type)) { C.Relocations.push_back( - {R_RELAX_TLS_IE_TO_LE, Type, &C, Offset, Addend, &Body}); + {R_RELAX_TLS_IE_TO_LE, Type, Offset, Addend, &Body}); return 1; } return 0; @@ -609,7 +609,7 @@ static void scanRelocs(InputSectionBase<ELFT> &C, ArrayRef<RelTy> Rels) { // when outputting this section. We also have to do it if the format // uses Elf_Rel, since in that case the written value is the addend. if (Constant || !RelTy::IsRela) - C.Relocations.push_back({Expr, Type, &C, Offset, Addend, &Body}); + C.Relocations.push_back({Expr, Type, Offset, Addend, &Body}); } else { // We don't know anything about the finaly symbol. Just ask the dynamic // linker to handle the relocation for us. diff --git a/lld/ELF/Relocations.h b/lld/ELF/Relocations.h index 556fab17f13..0d0b0f2b5d9 100644 --- a/lld/ELF/Relocations.h +++ b/lld/ELF/Relocations.h @@ -15,6 +15,7 @@ namespace lld { namespace elf { class SymbolBody; +class InputSectionData; template <class ELFT> class InputSection; template <class ELFT> class InputSectionBase; @@ -66,10 +67,9 @@ enum RelExpr { R_TLSLD_PC }; -template <class ELFT> struct Relocation { +struct Relocation { RelExpr Expr; uint32_t Type; - InputSectionBase<ELFT> *InputSec; uint64_t Offset; uint64_t Addend; SymbolBody *Sym; |