<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jan 30, 2018 at 1:48 PM, Rafael Avila de Espindola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Rui Ueyama via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> writes:<br>
<br>
> I feel like we should stop using `Live` bit for output sections. Input sections need that flag because they are gc'ed, but for output sections, we shouldn't create useless output sections in the first place. I feel like the current output sections have too many states and that makes writing code harder.<br>
<br>
</span>It is hard to know upfront it an output section will be useless or not.<br>
<br>
We have to create them when we first parse the linker script, and we<br>
only know that they are useless once no orphan is assigned to them.<br>
<br>
It might be possible to just remove them instead of using the Live<br>
bit. That would be an interesting experiment.<br></blockquote><div><br></div><div>At least we have to update the comment about the Live bit in InputSections.h. It is intended to be used only by the garbage collector, and use of OutputSections wasn't intended when it's designed.</div></div></div></div>