[PATCH] D22749: [ELF] - Linkerscript: Implemented SORT command

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 25 06:57:34 PDT 2016


grimar added inline comments.

================
Comment at: ELF/LinkerScript.cpp:139
@@ +138,3 @@
+                return A->getSectionName() < B->getSectionName();
+              return compareFileNames(A->getFile(), B->getFile());
+            });
----------------
evgeny777 wrote:
> What exact sorting order should be used? Shouldn't file name have greater priority than section name?
> 
> Also how about this one:
> ```
> *(SORT(*.data.*))
> ```
> vs this one:
> ```
> SORT(*)(*.data.*)
> ```
I think my first iteration was correct. SORT can be applied both to sections and to filenames separatelly. Since I am applying it for sections here, no need to sort filenames.
As you mentioned documentation says "the linker will sort the files or sections into ascending order by name". Its a bit confusing, but says correct thing. files OR sections. I am going to revert this to previous iteration.


https://reviews.llvm.org/D22749





More information about the llvm-commits mailing list