[PATCH] D13950: ELF2: Implement --gc-sections.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 21 15:30:52 PDT 2015


ruiu added inline comments.

================
Comment at: ELF/Writer.cpp:425
@@ -424,3 +424,3 @@
     for (InputSectionBase<ELFT> *C : F->getSections()) {
-      if (!C || C == &InputSection<ELFT>::Discarded)
+      if (!C || !C->isLive() || C == &InputSection<ELFT>::Discarded)
         continue;
----------------
rafael wrote:
> Can you check for "this == &InputSection<ELFT>::Discarded" in isLive?
We can, but I'm not sure if that's the right thing to do. Section merging and garbage collection are basically orthogonal, so hiding one thing behind the other's predicate may be confusing.


http://reviews.llvm.org/D13950





More information about the llvm-commits mailing list