[PATCH] D101569: [LLD] [COFF] Fix automatic export of symbols from LTO objects

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 11 11:23:44 PDT 2021


mstorsjo added inline comments.


================
Comment at: lld/COFF/InputFiles.cpp:1047
+public:
+  FakeSection(int C) {
+    Characteristics = C;
----------------
rnk wrote:
> Can this be marked constexpr? We want to avoid any dynamic initialization if possible.
Hmm, I'll have to see.


================
Comment at: lld/COFF/InputFiles.cpp:1054
+FakeSection ltoDataSection(IMAGE_SCN_CNT_INITIALIZED_DATA);
+SectionChunk ltoTextSectionChunk(nullptr, &ltoTextSection);
+SectionChunk ltoDataSectionChunk(nullptr, &ltoDataSection);
----------------
rnk wrote:
> The SectionChunk constructor is non-trivial, so this will definitely create dynamic initialization. I guess that's OK, LLD isn't really structured as a library anyway.
Yeah this bit isn't ideal. I guess it's still tolerable for a library, even if it isn't optimal.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101569



More information about the llvm-commits mailing list