[PATCH] D44622: [ELF] - Fix for "LLD crashes with --emit-relocs when trying to proccess .eh_frame"

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 20 01:20:54 PDT 2018


grimar added a comment.

In https://reviews.llvm.org/D44622#1042505, @rafael wrote:

> I think doing two passes in LinkerScript::addOrphanSections might be the
>  best solution as it is simple and handles even synthetic tests like using
>  a linker script to assign .eh_frame to an output section with a
>  different name.
>
> Cheers,
> Rafael


I tried to do this while investigated the ways to fix an issue.
What I did not like with such approach was:

1. Amount of changes was larger than in this patch.
2. Changes were in a generic code, but --emit-relocs + .eh_frame is a very specific corner case.

And I think it can not be used for something else because we
explicitly do not support reordered objects.
So I tried to find a way to isolate the fix from the common flow.
(like this patch do)

I'll post the patch for above to demonstrate results I had though.

I also tried one more way: during combining of eh_frames I moved
synthetic EhFrame in place of the first .eh_frame. With that, it also guaranteed
the proper order, though broke a large number of test cases and particularly
moved EhFrame before EhFrameHdr. So I refused from such approach too.


https://reviews.llvm.org/D44622





More information about the llvm-commits mailing list