[PATCH] D39058: [ELF] - Simplify reporting of garbage collected sections.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 19 05:19:48 PDT 2017


grimar added inline comments.


================
Comment at: ELF/LinkerScript.cpp:286
     for (InputSectionBase *Sec : InputSections) {
-      if (Sec->Assigned)
+      if (Sec->Assigned || !Sec->Live)
         continue;
----------------
ruiu wrote:
> Question: is it possible that a section is assigned to some output section but is not live? It sounds like a bad state to me.
Yes, it is possible for following case:
`/DISCARD/ : {*(.text*)}`
Here we set Assigned flag for .text. It is probably OK it seems ?

(I would probably try to completely get rid of 'Assigned' flag, I think we should be able to do that).


https://reviews.llvm.org/D39058





More information about the llvm-commits mailing list