[PATCH] D14140: [ELF2] SECTIONS command basic support

Denis Protivensky via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 29 08:31:01 PDT 2015


denis-protivensky added inline comments.

================
Comment at: ELF/Writer.cpp:614
@@ -574,3 +613,3 @@
 
-  std::stable_sort(OutputSections.begin(), OutputSections.end(),
-                   compareOutputSections<ELFT>);
+  std::stable_sort(
+      OutputSections.begin(), OutputSections.end(),
----------------
ruiu wrote:
> denis-protivensky wrote:
> > ruiu wrote:
> > > I don't like to add more code to createSections() which is already too long. Move this lambda out of this function.
> > I need `RegularSections`, which is local to the method. It's captured in the lambda, and I think it would be ugly to pass it to the comparison function along with two output sections to compare. Any ideas how to make it better?
> Why do you need RegularSections in the first place? What is this !RegularSections.(A)||!RegularSections.count(B) condition for?
The intent is to sort 'specific' sections like .symtab, .strtab and others with default sorting order even if some of these names are defined in linker script. Can't figure out why the tests pass without this check as I thought I specifically checked that case. Will look at this more.


http://reviews.llvm.org/D14140





More information about the llvm-commits mailing list