Remove redundant variable.
authorRui Ueyama <ruiu@google.com>
Tue, 9 Aug 2016 04:31:21 +0000 (04:31 +0000)
committerRui Ueyama <ruiu@google.com>
Tue, 9 Aug 2016 04:31:21 +0000 (04:31 +0000)
llvm-svn: 278094

lld/ELF/OutputSections.cpp
lld/ELF/OutputSections.h
lld/ELF/Writer.cpp

index 621405b..10d08c6 100644 (file)
@@ -395,8 +395,9 @@ template <class ELFT> unsigned RelocationSection<ELFT>::getRelocOffset() {
 }
 
 template <class ELFT> void RelocationSection<ELFT>::finalize() {
-  this->Header.sh_link = Static ? Out<ELFT>::SymTab->SectionIndex
-                                : Out<ELFT>::DynSymTab->SectionIndex;
+  this->Header.sh_link = isOutputDynamic<ELFT>()
+                             ? Out<ELFT>::DynSymTab->SectionIndex
+                             : Out<ELFT>::SymTab->SectionIndex;
   this->Header.sh_size = Relocs.size() * this->Header.sh_entsize;
 }
 
index 5f5b691..bf89366 100644 (file)
@@ -328,8 +328,6 @@ public:
   void writeTo(uint8_t *Buf) override;
   bool hasRelocs() const { return !Relocs.empty(); }
 
-  bool Static = false;
-
 private:
   bool Sort;
   std::vector<DynamicReloc<ELFT>> Relocs;
index bda9c8d..f078b8a 100644 (file)
@@ -838,10 +838,8 @@ template <class ELFT> void Writer<ELFT>::addPredefinedSections() {
 
   // We always need to add rel[a].plt to output if it has entries.
   // Even during static linking it can contain R_[*]_IRELATIVE relocations.
-  if (Out<ELFT>::RelaPlt && Out<ELFT>::RelaPlt->hasRelocs()) {
+  if (Out<ELFT>::RelaPlt && Out<ELFT>::RelaPlt->hasRelocs())
     Add(Out<ELFT>::RelaPlt);
-    Out<ELFT>::RelaPlt->Static = !isOutputDynamic<ELFT>();
-  }
 
   if (needsGot())
     Add(Out<ELFT>::Got);