[PATCH] D38613: [ELF] - Change how we deal with unused synthetic sections.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 30 14:34:10 PST 2018


On Tue, Jan 30, 2018 at 1:48 PM, Rafael Avila de Espindola <
rafael.espindola at gmail.com> wrote:

> Rui Ueyama via Phabricator <reviews at reviews.llvm.org> writes:
>
> > 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.
>
> It is hard to know upfront it an output section will be useless or not.
>
> We have to create them when we first parse the linker script, and we
> only know that they are useless once no orphan is assigned to them.
>
> It might be possible to just remove them instead of using the Live
> bit. That would be an interesting experiment.
>

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180130/44446d44/attachment.html>


More information about the llvm-commits mailing list