[PATCH] D65903: [LLD] [COFF] Allow using custom .edata from input object files

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 19 22:38:11 PDT 2019


ruiu added inline comments.


================
Comment at: COFF/Writer.cpp:1026-1029
+  if (!edataSec->chunks.empty()) {
+    edataStart = edataSec->chunks.front();
+    edataEnd = edataSec->chunks.back();
+  }
----------------
Do you have to use these two variables?


================
Comment at: COFF/Writer.cpp:1376
   buf += sizeof(*dir) * numberOfDataDirectory;
-  if (!config->exports.empty()) {
-    dir[EXPORT_TABLE].RelativeVirtualAddress = edata.getRVA();
-    dir[EXPORT_TABLE].Size = edata.getSize();
+  if (edataStart) {
+    dir[EXPORT_TABLE].RelativeVirtualAddress = edataStart->getRVA();
----------------
Looks like you can check if `!edataSec->chunks.empty()` here and use `edataSec->chunks.front()` and `back()` in the following lines.


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

https://reviews.llvm.org/D65903





More information about the llvm-commits mailing list