This is an archive of the discontinued LLVM Phabricator instance.

[COFF] Allow comdat discarding and GC of non-section chunks
AbandonedPublic

Authored by rnk on Jun 21 2017, 2:08 PM.

Details

Reviewers
ruiu
pcc
Summary

Move the "Live" and "Discarded" bools from SectionChunk to Chunk. This
will allow us to add a new kind of chunk for control flow guard that
participates in comdat resolution and dead stripping. It is very similar
to .sxdata and SEHTableChunk, but object files may have more than one
such section.

Event Timeline

rnk created this revision.Jun 21 2017, 2:08 PM
ruiu edited edge metadata.Jun 21 2017, 2:19 PM

LGTM given that you are going to enable GC for other chunks.

rnk abandoned this revision.Jun 21 2017, 4:14 PM

After hacking a bit more on this, I decided not to do this. I think we'll treat these .gfids chunks as SectionChunks that are not held in ObjectFile::Chunks, the same way we treat DebugChunks. They will be regular SectionChunks that participate in section GC, but they will not be emitted into the output, just like .debug$S chunks. We'll iterate them later, check which ones are live, and create a single chunk for the whole table.