[PATCH] D50917: [LLD] [COFF] Support MinGW automatic dllimport of data

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 27 00:26:23 PDT 2018


ruiu added inline comments.


================
Comment at: COFF/Chunks.cpp:428
 
+// Check whether a static relocation of type Type can be deferred and
+// handled at runtime as a pseudo relocation (for references to a module
----------------
I'd add `MinGW specific.` to all functions that are added in this patch.


================
Comment at: COFF/Chunks.cpp:525
+    Res.emplace_back(
+        RuntimePseudoReloc(Target, this, Rel.VirtualAddress, SizeInBits));
+  }
----------------
`SizeInBits` is called `Flags` in `RuntimePseudoReloc` class. I was little confused because `Flags` sounds like bit flags. Can you consistently use one name?


================
Comment at: COFF/SymbolTable.cpp:163
+  log("Automatically importing " + Name + " from " + Imp->getDLLName());
+  // Replace the reference directly to a variable with a reference
+  // to the import address table instead. This obviously isn't right,
----------------
nit: add a blank line.


================
Comment at: COFF/Writer.cpp:191
   bool SetNoSEHCharacteristic = false;
+  std::vector<RuntimePseudoReloc> RuntimePseudoRelocs;
 
----------------
Looks like this variable is used only by one function. Can this be a local variable?


https://reviews.llvm.org/D50917





More information about the llvm-commits mailing list