[PATCH] D39045: [ELF] - Simplify output section creation.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 30 04:48:01 PDT 2017


grimar added inline comments.


================
Comment at: ELF/LinkerScript.cpp:464-468
+    // We should report discarded sections for case when no SECTIONS command
+    // is present. For other case we already reported it during processing
+    // layout commands when computed input sections lists.
+    if (!S->Live && !HasSectionsCommand)
+      reportDiscarded(S);
----------------
ruiu wrote:
> I do not understand this particular change, but I guess this will be removed by your other change.
Yep, it's gone.


================
Comment at: ELF/Writer.cpp:173-176
+  // When no SEECTIONS command is present, we want to apply default sorting and
+  // fabricate minimum default commands, like if trivial SECTIONS command would
+  // be given.
+  if (!Script->HasSectionsCommand) {
----------------
grimar wrote:
> ruiu wrote:
> > Hmm, at this point, I started wondering if the changes to this function actually improves the function. Now, it isn't easy to point out which code is executed when linker script is given/not givne.
> It is not good place to apply default sorting I think. 
> I prepared patch to cleanup this place: D39371.
> 
> It should relax this place if we land it, what do you think ?
With help of D39371 and one more change, this code was completly removed.


https://reviews.llvm.org/D39045





More information about the llvm-commits mailing list