[PATCH] D50688: [LLD] Sort alloc/non-alloc output sections in linkerscripts

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 14 05:48:59 PDT 2018


grimar added a comment.

In https://reviews.llvm.org/D50688#1198810, @kschwarz wrote:

> Issueing a warning in this case would also be fine for me. 
>  ...
>  So would you prefer a warning instead of messing with the order of sections?


I have no strong feeling, but:

Giving a warning is less intrusive and gives a chance to report a possible issue in the script,
so if we have a choice to not support that then I would go this way perhaps.
(I think `Writer<ELFT>::checkSections()` is probably the right place to do the check)



================
Comment at: test/ELF/linkerscript/Inputs/nonalloc.s:10
+.short 10
+.byte 20
----------------
kschwarz wrote:
> grimar wrote:
> > I think you do not need this input. You can use echo to inline it,
> > see for example:
> > https://github.com/llvm-mirror/lld/blob/master/test/ELF/linkerscript/bss-fill.test
> > 
> > I would expect something with less data instructions like
> > `echo '.section .text,"ax"; .quad 0; .section .data,"aw";  .long 0; .section .other,"";  .byte 0; '`
> I thought I read somewhere that echo'ing should be avoided in new tests, but that could be wrong. Will update this test.
That is true, we are trying to avoid multiple echo'ing, but single line echo is better than additional input file for readability.
Many of our *.test files have it, so it is fine.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D50688





More information about the llvm-commits mailing list