[PATCH] D29170: [ELF] - Remove unnessesary checks from GC logic.
Davide Italiano via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 26 08:38:25 PST 2017
davide added inline comments.
================
Comment at: ELF/MarkLive.cpp:159-161
-// We do not garbage-collect two types of sections:
-// 1) Sections used by the loader (.init, .fini, .ctors, .dtors or .jcr)
-// 2) Non-allocatable sections which typically contain debugging information
----------------
grimar wrote:
> davide wrote:
> > grimar wrote:
> > > davide wrote:
> > > > Why did you change this comment?
> > > > We still shouldn't reclaim !SHF_ALLOC sections as they can contain debug infos
> > > Because method is called isReserved().
> > > Previously it has logic that kept !SHF_ALLOC, though !SHF_ALLOC sections are not actually reserved.
> > > But anyways now it does not have this logic anymore, there is no point to write this in comment here, it is not possible to support comments like this, when real logic is far away.
> > Where we prevent `!SHF_ALLOC` sections from being reclaimed? The comment should go there, then,
> We set Live bit for all !SHF_ALLOC sections in InputSectionBase constructor:
> ```
> : InputSectionData(SectionKind, Name, Data,
> !Config->GcSections || !(Flags & SHF_ALLOC)),
> ```
Please move the comment there then.
https://reviews.llvm.org/D29170
More information about the llvm-commits
mailing list