[PATCH] D60628: [LLD] [COFF] Link crtend.o as the last object file

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 15 01:30:25 PDT 2019


ruiu added inline comments.


================
Comment at: COFF/Driver.cpp:95
+// Returns true if S matches /Filename.?\.o$/.
+static bool isCrtBeginEnd(StringRef S, StringRef Filename) {
+  if (!S.endswith(".o"))
----------------
Since Filename is always "crtend", I'd hardcode that and merge this function with isCrtend.


================
Comment at: COFF/Driver.cpp:1685
 
+    // Make sure the crtend.o object is the last object file.
+    for (auto I = ObjFile::Instances.begin(), E = ObjFile::Instances.end();
----------------
Could you expand this comment a little to explain why that object file should be at the end of the input file list?


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

https://reviews.llvm.org/D60628





More information about the llvm-commits mailing list