This is an archive of the discontinued LLVM Phabricator instance.

MC/COFF: Do not emit forward associative section referenceds.
ClosedPublic

Authored by ruiu on Feb 16 2017, 6:35 PM.

Details

Summary

MSVC link.exe cannot handle associative sections that refer later
sections in the section header. Technically, such COFF object doesn't
violate the Microsoft COFF spec, as the spec doesn't say anything
about that, but still we should avoid doing that to make it compatible
with MS tools.

This patch assigns smaller section numbers to non-associative sections
and larger numbers to associative sections. This should resolve the
compatibility issue.

Event Timeline

ruiu created this revision.Feb 16 2017, 6:35 PM
This revision was automatically updated to reflect the committed changes.