This is an archive of the discontinued LLVM Phabricator instance.

[LLD] Fix findOrphanPos to consistently ignore "dead" OutputSection's
ClosedPublic

Authored by andrewng on Oct 9 2017, 8:44 AM.

Details

Reviewers
ruiu
rafael
Summary

When findOrphanPos does the reverse search to find the OutputSection
preceding the orphan's insertion point, look for a live OutputSection
and ignore "dead" OutputSection's. This matches the behaviour of the
forward search performed earlier in this function.

Added test which without the above fix fails as a result of an orphan
executable section being incorrectly placed in a non-executable segment.

Diff Detail

Event Timeline

andrewng created this revision.Oct 9 2017, 8:44 AM
ruiu accepted this revision.Oct 9 2017, 1:18 PM

LGTM

This revision is now accepted and ready to land.Oct 9 2017, 1:18 PM
andrewng closed this revision.Oct 10 2017, 3:16 AM

Committed in rL315292: [LLD] Fix findOrphanPos to consistently ignore "dead" OutputSection's.