<div dir="ltr"><div>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?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 15, 2016 at 12:32 PM, Eugene Leviant <span dir="ltr"><<a href="mailto:evgeny.leviant@gmail.com" target="_blank">evgeny.leviant@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">evgeny777 added a comment.<br>
<br>
Let's elaborate the idea. The main problem is that symbol 'D' inside resolveReloc() may point to InputSectionBase<ELFT>::<wbr>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?<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D24616" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D24616</a><br>
<br>
<br>
<br>
</div></div></blockquote></div><br></div>