forked from OSchip/llvm-project
parent
a8f6feaa1a
commit
cbd434a6c4
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue