<div dir="ltr">Great news, Rafel!<div><br></div><div>I know of a few other issues for which I use quick fixes/patches:</div><div><br></div><div>a) LOADADDR and LMA stuff (on review)</div><div>b) PHDR size is now calculated like VMA(last) - VMA(first). This sometimes results in incorrect segment size, when LMA is used.</div><div>c) There are cases when mergeable and non-mergeable sections are joined in linker script and assignment to '.' is used:</div><div><br></div><div>.ro_data : {</div><div> ro_begin = .;</div><div> *(.rodata) *(.rodata.*)</div><div> . = ALIGN(0x1000);</div><div> ro_end = .</div><div>};</div><div><br></div><div>Current approach with multiple output sections doesn't work here</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-09-20 20:53 GMT+03:00 Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It is pretty annoying to check if a given linker script behaviour is<br>
intentional or not. I think there are two main factors contributing to<br>
it<br>
<br>
* It is not very well documented.<br>
* Linker scripts are responsible for a lot of the layout.<br>
<br>
The second part makes it difficult to reduce a case where bfd and gold<br>
work but lld does not. Running delta on a linker script will normally<br>
produce a case where it is just incidental that bfd and/or gold<br>
produce a working output.<br>
<br>
Given that, I think at least for now we need to depend a bit on<br>
integration testing. The last fixes I did on linker script handling<br>
were so that I could create a "frankenstein ld": lld, but with bfd's<br>
linker script.<br>
<br>
With r281989 it is now able to link all of llvm/lld/clang on x86_64<br>
and all tests pass :-)<br>
<br>
To use it, edit the attached script to point to the linker script you<br>
want and put it the same directory as ld.lld. Then run clang with<br>
-fuse-ld=frankenstein.<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote></div><br></div>