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

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 9 17:55:33 PDT 2017


ruiu added a comment.

I think `Live` bit is abused in the output sections. That flag was introduced for gc, and originally only input sections have the flag. After that, a new class was introduced as a parent of both input sections and output sections, and at some point, we started using `Live` bit for output sections to indicate whether we want to emit it or not. But as far as I know, it was not discussed if that is a good approach.

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.


https://reviews.llvm.org/D38613





More information about the llvm-commits mailing list