From 664c6522faab509ec28d7e26b535d30c746c8958 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 7 Sep 2016 20:37:34 +0000 Subject: [PATCH] Delete dead field. NFC. llvm-svn: 280856 --- lld/ELF/InputSection.cpp | 2 +- lld/ELF/InputSection.h | 2 +- lld/ELF/Relocations.cpp | 22 +++++++++++----------- 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 321c880..b8db080 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -346,7 +346,7 @@ void InputSectionBase::relocate(uint8_t *Buf, uint8_t *BufEnd) { } const unsigned Bits = sizeof(uintX_t) * 8; - for (const Relocation &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 3b7c201..7529e4e 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> Relocations; + std::vector Relocations; }; template InputSectionBase InputSectionBase::Discarded; diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp index 47c0406..0cd9088 100644 --- a/lld/ELF/Relocations.cpp +++ b/lld/ELF/Relocations.cpp @@ -97,7 +97,7 @@ handleMipsTlsRelocation(uint32_t Type, SymbolBody &Body, Out::RelaDyn->addReloc({Target->TlsModuleIndexRel, Out::Got, Out::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::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::Got->addTlsIndex()) Out::RelaDyn->addReloc({Target->TlsModuleIndexRel, Out::Got, Out::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::Got->addEntry(Body); Out::RelaDyn->addReloc({Target->TlsGotRel, Out::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 &C, ArrayRef 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 556fab1..0d0b0f2 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 InputSection; template class InputSectionBase; @@ -66,10 +67,9 @@ enum RelExpr { R_TLSLD_PC }; -template struct Relocation { +struct Relocation { RelExpr Expr; uint32_t Type; - InputSectionBase *InputSec; uint64_t Offset; uint64_t Addend; SymbolBody *Sym; -- 2.7.4