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

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 24 12:49:29 PDT 2018


pcc added inline comments.


================
Comment at: COFF/Chunks.h:420
 
+class PseudoRelocChunk : public Chunk {
+public:
----------------
Would it be simpler to have a single `PseudoRelocChunk` for all the pseudo-relocs instead of creating a separate one for each reloc?


================
Comment at: COFF/Chunks.h:447
+
+  static RuntimePseudoReloc makeListHeader() {
+    return RuntimePseudoReloc(nullptr, nullptr, 0, 1);
----------------
It looks like this function is not used.


================
Comment at: COFF/SymbolTable.cpp:208
+        // this Symbol.
+        Sym->replaceKeepingName(Imp, sizeof(DefinedImportData));
+        cast<DefinedImportData>(Sym)->IsRuntimePseudoReloc = true;
----------------
It looks like the RVA of the IAT entry is stored in the pseudo-reloc. So does this need to be relocated to the IAT entry? Could you replace it with a `DefinedAbsolute` of value 0 for example?


https://reviews.llvm.org/D50917





More information about the llvm-commits mailing list