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

Eugene Leviant via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 25 05:00:59 PDT 2016


evgeny777 added inline comments.

================
Comment at: ELF/LinkerScript.cpp:137
@@ +136,3 @@
+            [](InputSectionBase<ELFT> *A, InputSectionBase<ELFT> *B) {
+        return A->getSectionName() < B->getSectionName();
+      });
----------------
grimar wrote:
> evgeny777 wrote:
> > grimar wrote:
> > > evgeny777 wrote:
> > > > What about SORT(*(.data))? How will .data sections be ordered?
> > > > 
> > > > 
> > > In the same order as linker see them ?
> > The should be sorted by file names, I think.
> SORT is alias for SORT_BY_NAME.
> I do not see anything about sorting by filename in that case.
> (https://sourceware.org/binutils/docs/ld/Input-Section-Wildcards.html#Input-Section-Wildcards)
Here is the quote from URL you posted

> When the SORT_BY_NAME keyword is used, the linker will sort the files or sections into ascending order by name before placing them in the output file.




https://reviews.llvm.org/D22749





More information about the llvm-commits mailing list