[PATCH] D24616: [ELF] Improve section GC for comdat groups

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 15 12:45:02 PDT 2016


Imagine any section that is in some comdat group have a GroupMembers
vector, so that starting from any comdat group member section, you can
reach all siblings in the same group. With that, all you have to do for a
section S to make all its siblings live is to do `for (InputSectionData
*Succ : S->GroupMember) Enque({Succ, 0});`. Doesn't it work?

On Thu, Sep 15, 2016 at 12:32 PM, Eugene Leviant <evgeny.leviant at gmail.com>
wrote:

> evgeny777 added a comment.
>
> Let's elaborate the idea. The main problem is that symbol 'D' inside
> resolveReloc() may point to InputSectionBase<ELFT>::Discarded. This
> happens because comdat group is added to only one object file and causes
> crash in GC, because forEachSuccessor implicitly casts Discarded to
> InputSection<ELFT> and tries to fetch relocs from it. How this
> 'GroupMembers' vector would help?
>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D24616
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160915/8d7299f1/attachment.html>


More information about the llvm-commits mailing list