Remove redundant variable.

llvm-svn: 278094
This commit is contained in:
Rui Ueyama 2016-08-09 04:31:21 +00:00
parent a8f6feaa1a
commit cbd434a6c4
3 changed files with 4 additions and 7 deletions

View 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;
}

View 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;

View 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);