Current implementation of LayoutInputSection relies on LLVM-style casting to InputSection<ELFT>, which is not a base class for it. The following statements will be successfully compiled and executed:
InputSection<ELFT> *I = ...; LayoutInputSection<ELFT> *L = cast<LayoutInputSection<ELFT>>(I);
And the following one cannot compile:
LayoutInputSection<ELFT> *L = static_cast<LayoutInputSection<ELFT> *>(I);
This patch eliminates LayoutInputSection by saving pointer to preceding input section in SymbolAssignment class.
Please write a comment for this class. It should describe why we need this class (because we want to have a base class which is not a template class).