[PATCH] D32749: [LLD][ELF] Fix problems with fabricateDefaultCommands() and --section-start

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 2 15:43:20 PDT 2017


ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: ELF/LinkerScript.cpp:431-433
   // The Sections with -T<section> are sorted in order of ascending address
   // we must use this if it is lower than StartAddr as calls to setDot() must
   // be monotonically increasing
----------------
Can you add full stops to this comment?


================
Comment at: ELF/LinkerScript.cpp:434
   // be monotonically increasing
-  if (!Config->SectionStartMap.empty()) {
-    uint64_t LowestSecStart = Config->SectionStartMap.begin()->second;
-    StartAddr = std::min(StartAddr, LowestSecStart);
-  }
+  if (!Config->SectionStartMap.empty())
+    for (auto& KV : Config->SectionStartMap)
----------------
You don't need to check if it is empty, as the following for-loop loops 0 times if it is empty.


https://reviews.llvm.org/D32749





More information about the llvm-commits mailing list