[PATCH] D28481: Respect section groups in GC

Evgeniy Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 10 13:44:29 PST 2017


eugenis added a comment.

In https://reviews.llvm.org/D28481#640940, @ruiu wrote:

> Hm, now I recall why we did that for C identifier sections. Sections with C identifier names can be garbage collected if no one is referring them, but that cannot be determined until we create output sections, and when we create output sections, it is usually too late to do GC. We could do something tricky to handle that, but it's probably not worth it.
>
> So, maybe I'm fine with this. But I think the implementation can be simplified. It feels it is doing too much ahead of time.


Could you elaborate? All this code does is store two words per each section that participates in a group. We do need to store the inverse dependency somewhere...

> Also the new condition `Sec->GroupSections.size() == 0 && isValidCIdentifier(S)` definitely needs a comment.

Will do. Also, it sounds like we want to extend this logic to all special sections (like .ctors below). Basically,
if (Sec->GroupSections.size() != 0) return false;
at the beginning of isReserved().


Repository:
  rL LLVM

https://reviews.llvm.org/D28481





More information about the llvm-commits mailing list