}
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;
}
void writeTo(uint8_t *Buf) override;
bool hasRelocs() const { return !Relocs.empty(); }
- bool Static = false;
-
private:
bool Sort;
std::vector<DynamicReloc<ELFT>> Relocs;
// 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);