[PATCH] D38724: [ELF] - Do not collect SHT_REL[A] sections unconditionally when --gc-sections and --emit-relocs used together.
Rui Ueyama via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 13 11:02:40 PDT 2017
ruiu added inline comments.
================
Comment at: ELF/MarkLive.cpp:219-221
+ // Not all sections are subject of garbage collection.
+ if (!canBeCollected(Sec))
return;
----------------
grimar wrote:
> ruiu wrote:
> > Why do you have to check this? All non-collectible sections have already been marked alive, so you don't need to check for the same condition again in this function.
> It is needed for REL[A] sections which are collectible. Initial condition exits
> early for non-alloc sections, but REL[A] sections are not-alloc, but collectible,
> so I want to let them go through.
> Updated comment.
I do not understand. All non-gc'able objects have already marked alive when the control flow reaches here. Why don't you use Sec->Live instead?
https://reviews.llvm.org/D38724
More information about the llvm-commits
mailing list