[PATCH] D35509: Covnert .[cd]tors to .{init, fini}_array using synthetic section.

Rafael Ávila de Espíndola via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 24 16:15:50 PDT 2017


rafael added inline comments.


================
Comment at: lld/ELF/SyntheticSections.h:136
 
+class InitFiniSection : public SyntheticSection {
+public:
----------------
Do we need a new type?

You can have a standalone function that does the conversion and creates a InputSection directly. Not that different from how .comment is created.


================
Comment at: lld/ELF/Writer.cpp:140
+template <class ELFT> static void convertCtorsDtorsToInitFini() {
+  for (InputSectionBase *&S : InputSections)
+    if (InputSection *IS = dyn_cast<InputSection>(S))
----------------
We have to check if all systems support .init_array. Ed, can you confirm?


https://reviews.llvm.org/D35509





More information about the llvm-commits mailing list