[PATCH] D55293: [LLD][COFF] Unmerged sections

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 18 06:14:24 PST 2018


mstorsjo marked an inline comment as done.
mstorsjo added inline comments.


================
Comment at: COFF/Writer.cpp:669
   uint32_t RDATA = IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_READ;
-  std::vector<Chunk *> &ImportTables = Map[{".idata$2", RDATA}];
-  if (!ImportTables.empty())
-    ImportTableStart = ImportTables.front();
-  for (Chunk *C : ImportTables)
-    ImportTableSize += C->getSize();
-
-  std::vector<Chunk *> &IAT = Map[{".idata$5", RDATA}];
-  if (!IAT.empty())
-    IATStart = IAT.front();
-  for (Chunk *C : IAT)
-    IATSize += C->getSize();
+  if (UnmergedSection *ImportSec = UnmergedSections[{".idata$2", RDATA}]) {
+    if (!ImportSec->Chunks.empty())
----------------
aganea wrote:
> mstorsjo wrote:
> > I'd maybe name it `ImportTableSec` or so - everything in .idata is relating to imports so `ImportSec` is a bit generic as it would go for all of them. This one specifically refers to the sections that `ImportTableStart`/`ImportTableSize` refers to.
> I changed the `.idata$2` reference to `ImportDirs` , and `.idata$5` reference to `ImportAddresses`. Does that sound better?
> 
Sounds good to me.


Repository:
  rLLD LLVM Linker

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

https://reviews.llvm.org/D55293





More information about the llvm-commits mailing list