[PATCH] D23924: [ELF] - Linkerscript: allow add MergeInputSection to regular OutputSection.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 31 06:09:06 PDT 2016


>>I was able to write a script that shows that symbols in merge sections
>>are already pretty broken:
>>
>>.abc : { zed0 = .; *(.foo); zed1 = .; *(.bar);  zed2 = .; *(.zed); zed3 = .; }
>>
>>running it on
>>
>>        .section        .foo,"aMS", at progbits,1
>>        .asciz  "abc123"
>>
>>        .section        .bar,"aMS", at progbits,1
>>        .asciz  "aabc123"
>>
>>        .section        .zed,"aMS", at progbits,1
>>        .asciz  "x"
>>
>>causes the symbols to point to pretty much arbitrary places when the
>>strings are merged. Given that, I am pretty sure we  can produce
>>multiple output sections and just error if there is a symbol
>>definition in a SHF_MERGE output section.
>>
>>Cheers,
>>Rafael
>
>Nice. I can prepare a patch restoring logic of multiple output sections creation then.
>
>George.

Patch is ready, I`ll upload it after D23768 ("[ELF] Linkerscript: eliminate LayoutInputSection")
be landed as I decided to rely on changes it does for simplification.

George.


More information about the llvm-commits mailing list