}
void flushSymbols();
void flushSection();
- void finalize();
private:
OutputSectionFactory<ELFT> &Factory;
Current = nullptr;
}
-template <class ELFT> void OutputSectionBuilder<ELFT>::finalize() {
- // Assign offsets to all sections which don't contain symbols
- for (OutputSectionBase<ELFT> *S : *OutputSections)
- if (llvm::find_if(OwningSections,
- [&](std::unique_ptr<LayoutInputSection<ELFT>> &L) {
- return L->OutSec == S;
- }) == OwningSections.end())
- S->assignOffsets();
-}
-
template <class ELFT>
static bool compareName(InputSectionBase<ELFT> *A, InputSectionBase<ELFT> *B) {
return A->getSectionName() < B->getSectionName();
// Remove from the output all the sections which did not meet
// the optional constraints.
filter();
- Builder.finalize();
}
template <class R, class T>
}
template <class ELFT> void assignOffsets(OutputSectionBase<ELFT> *Sec) {
- // Non-zero size means we have assigned offsets earlier in
- // OutputSectionBuilder<ELFT>::finalize
auto *OutSec = dyn_cast<OutputSection<ELFT>>(Sec);
- if (Sec->getSize() || !OutSec)
+ if (!OutSec) {
+ Sec->assignOffsets();
return;
+ }
typedef typename ELFT::uint uintX_t;
uintX_t Off = 0;
Dot += Sec->getSize();
continue;
}
+ Sec->assignOffsets();
}
}