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

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


grimar added inline comments.

================
Comment at: ELF/LinkerScript.cpp:664
@@ +663,3 @@
+                                               bool Keep) {
+  if (peek() == "SORT") {
+    expect("SORT");
----------------
evgeny777 wrote:
> I would check for "SORT" in readOutputSectionDescription.
I prefer my way.
KEEP is just a part of IS description. Input section wildcard can be surrounded by KEEP.
(https://sourceware.org/binutils/docs/ld/Input-Section-Keep.html#Input-Section-Keep).

SORT as well as other attributes like EXCLUDE_FILE is relative to wildcards itself. It is not at the same level as KEEP in my understanding.

================
Comment at: ELF/LinkerScript.cpp:137
@@ +136,3 @@
+            [](InputSectionBase<ELFT> *A, InputSectionBase<ELFT> *B) {
+              if (A->getSectionName() != B->getSectionName())
+                return A->getSectionName() < B->getSectionName();
----------------
Agree.


https://reviews.llvm.org/D22749





More information about the llvm-commits mailing list