[PATCH] D58808: ELF: Extract a non-ELFT base class for VersionNeedSection.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 28 20:20:47 PST 2019


pcc added a comment.

In D58808#1414591 <https://reviews.llvm.org/D58808#1414591>, @ruiu wrote:

> 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.


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.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58808/new/

https://reviews.llvm.org/D58808





More information about the llvm-commits mailing list