ld.frankenstein

Eugene Leviant via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 20 11:07:30 PDT 2016


Great news, Rafel!

I know of a few other issues for which I use quick fixes/patches:

a) LOADADDR and LMA stuff (on review)
b) PHDR size is now calculated like VMA(last) - VMA(first). This sometimes
results in incorrect segment size, when LMA is used.
c) There are cases when mergeable and non-mergeable sections are joined in
linker script and assignment to '.' is used:

.ro_data :  {
   ro_begin = .;
   *(.rodata) *(.rodata.*)
   . = ALIGN(0x1000);
   ro_end = .
};

Current approach with multiple output sections doesn't work here

2016-09-20 20:53 GMT+03:00 Rafael EspĂ­ndola <rafael.espindola at gmail.com>:

> It is pretty annoying to check if a given linker script behaviour is
> intentional or not. I think there are two main factors contributing to
> it
>
> * It is not very well documented.
> * Linker scripts are responsible for a lot of the layout.
>
> The second part makes it difficult to reduce a case where bfd and gold
> work but lld does not. Running delta on a linker script will normally
> produce a case where it is just incidental that bfd and/or gold
> produce a working output.
>
> Given that, I think at least for now we need to depend a bit on
> integration testing. The last fixes I did on linker script handling
> were so that I could create a "frankenstein ld": lld, but with bfd's
> linker script.
>
> With r281989 it is now able to link all of llvm/lld/clang on x86_64
> and all tests pass :-)
>
> To use it, edit the attached script to point to the linker script you
> want and put it the same directory as ld.lld. Then run clang with
> -fuse-ld=frankenstein.
>
> Cheers,
> Rafael
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160920/375a8546/attachment.html>


More information about the llvm-commits mailing list