We're going to need a separate VersionNeedSection for each partition, and
the partition data structure won't be templated.
With this the VersionTableSection class no longer needs ELFT, so detemplate it.
Paths
| Differential D58808
ELF: Extract a non-ELFT base class for VersionNeedSection. ClosedPublic Authored by pcc on Feb 28 2019, 6:41 PM.
Details Summary We're going to need a separate VersionNeedSection for each partition, and With this the VersionTableSection class no longer needs ELFT, so detemplate it.
Diff Detail
Event TimelineComment Actions I wonder if we can just get rid of ELFT from the class. At runtime we know endianess and word width, so in theory we can create a version table without ELFT. I'm not totally sure if this makes things easier to handle, but many classes are template with ELFT because they transitively use a ELFT-templated class. So removing ELFT from one class might allow us remove ELFT from more classes. Comment Actions
You mean from VersionNeedSection? Yes in theory, but now that createSyntheticSections is the only direct user of VersionNeedSection I think we'd also need to remove templating from RelocationSection, SymbolTableSection etc in order to detemplate anything else. And those classes are similar to VersionNeedSection in that they need to manipulate ELF data structures directly, so it's not clear that it's the right way to go. That said, now that I've removed InX there does appear to be some low hanging fruit in finalizeSections() that can be detemplated. Let me see if I can send a patch. This revision is now accepted and ready to land.Mar 1 2019, 4:23 PM Closed by commit rL355478: ELF: Extract a non-ELFT base class for VersionNeedSection. (authored by pcc). · Explain WhyMar 5 2019, 7:09 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 189441 lld/trunk/ELF/Driver.cpp
lld/trunk/ELF/SyntheticSections.h
lld/trunk/ELF/SyntheticSections.cpp
lld/trunk/ELF/Writer.cpp
|