This is an archive of the discontinued LLVM Phabricator instance.

ELF: Move section merging before ICF. NFCI.
ClosedPublic

Authored by pcc on Jun 11 2017, 4:08 PM.

Event Timeline

pcc created this revision.Jun 11 2017, 4:08 PM
ruiu added inline comments.Jun 11 2017, 4:29 PM
lld/ELF/Driver.cpp
1006–1008

I first read this comment as markLive does all these things. I guess this comment describes all the code until writeResult. This is a bit confusing.

1013–1014

Should we move this to mergeSections?

pcc added inline comments.Jun 11 2017, 4:38 PM
lld/ELF/Driver.cpp
1013–1014

Seems reasonable. It'll need to be called something like decompressAndMergeSections, but that's probably fine.

pcc updated this revision to Diff 102143.Jun 11 2017, 4:47 PM
  • Address review comments
pcc marked 2 inline comments as done.Jun 11 2017, 4:47 PM
pcc added inline comments.
lld/ELF/Driver.cpp
1006–1008

Okay, now all the size optimizations are in one block like before.

ruiu accepted this revision.Jun 11 2017, 4:50 PM

LGTM

lld/ELF/Driver.cpp
1003

Can you add a comment saying that this adds a .comment section containing a version string, and we have to do that before mergeSections because the .comment section is a mergeable section?

This revision is now accepted and ready to land.Jun 11 2017, 4:50 PM
This revision was automatically updated to reflect the committed changes.
pcc marked an inline comment as done.