This is an archive of the discontinued LLVM Phabricator instance.

[ELF] When placing orphans, handle case when last section is dead
ClosedPublic

Authored by phosek on Oct 22 2017, 3:16 PM.

Details

Summary

r315292 introduced a change that's supposed consistently ignore
"dead" output sections when placing orphans. Unfortunately, that
change doesn't handle the special case when the orphan section is
second to last section and the last section is dead (e.g. because
it's being discarded) introducing a regression in some cases.

This change handles this case by using the same predicate when
checking the last section.

Diff Detail

Repository
rL LLVM

Event Timeline

phosek created this revision.Oct 22 2017, 3:16 PM
phosek edited the summary of this revision. (Show Details)Oct 22 2017, 3:16 PM
ruiu accepted this revision.Oct 22 2017, 5:36 PM

LGTM

ELF/Writer.cpp
1014 ↗(On Diff #119801)

nit: we usually use P for a pair, so maybe Pred is a better name.

This revision is now accepted and ready to land.Oct 22 2017, 5:36 PM
phosek updated this revision to Diff 119804.Oct 22 2017, 5:50 PM
phosek marked an inline comment as done.
phosek edited the summary of this revision. (Show Details)
This revision was automatically updated to reflect the committed changes.