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

Konstantin Schwarz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 14 05:29:28 PDT 2018


kschwarz added a comment.

Issueing a warning in this case would also be fine for me. The problem occured in a much larger context with nested includes of several linker scripts, so it was not obvious which directive was an issue, but the ELF was missing several expected program headers.

I think we do not have to support the exact same linker scripts as GNU, but we should try to inform the user that we do not support specific things (like it is done when setting the location counter backwards).

So would you prefer a warning instead of messing with the order of sections?



================
Comment at: test/ELF/linkerscript/Inputs/nonalloc.s:10
+.short 10
+.byte 20
----------------
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.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D50688





More information about the llvm-commits mailing list