[PATCH] D104530: [LLD] [COFF] Support linking directly against DLLs in MinGW mode

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 1 14:16:57 PDT 2021


rnk added inline comments.


================
Comment at: lld/COFF/InputFiles.cpp:1164
+    bool code = false;
+    for (size_t i = 1, e = coffObj->getNumberOfSections(); i <= e; i++) {
+      const coff_section *sec = CHECK(coffObj->getSection(i), this);
----------------
Factoring out the computation of this boolean would help readability. Initially I thought "this should be a data structure", but there are so few PE sections that it really doesn't matter.


================
Comment at: lld/COFF/InputFiles.cpp:1175-1178
+    s->dllName = dllName;
+    s->symbolName = symbolName;
+    s->importType = code ? ImportType::IMPORT_CODE : ImportType::IMPORT_DATA;
+    s->nameType = ImportNameType::IMPORT_NAME;
----------------
Instead of copying these strings into a newly allocated data structure, is there some way to put the export directory index into the LazyDLLSymbol? Most of the fields of DLLFile::Symbol seem like they can be calculated later after symbol resolution. This would avoid copying all the exported strings once.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104530



More information about the llvm-commits mailing list