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

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 31 02:17:20 PST 2018


>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.
>
>Cheers,
>Rafael

I think I tried this earlier. We currently remove empty output sections after
doing sortSections().
Following comment explains why we probably can do that only that late atm:
https://reviews.llvm.org/D39047#907755

At that time I also experimented with slightly different approach.
It was https://reviews.llvm.org/D38613. It set Live bit for synthetic
sections and corresponding output sections only in case it is known
them are live. That way was no need to trigger output section Live bit
forth and back and to remove unused synthetic sections.
Now I do not feel it is a better approach though.

George.


More information about the llvm-commits mailing list