Page MenuHomePhabricator

Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline

[sancov] Put .SCOV* sections into the right comdat groups on COFF

Authored by rnk on Nov 7 2018, 2:41 PM.



Avoids linker errors about relocations against discarded sections.

This was uncovered during the clang roll here:

After this change, libGLESv2 links successfully for me.

Diff Detail


Event Timeline

rnk created this revision.Nov 7 2018, 2:41 PM
morehouse added inline comments.Nov 7 2018, 4:06 PM
82 ↗(On Diff #173037)

Does COFF not have comdat naming collisions for local symbols like ELF does?

rnk added inline comments.Nov 7 2018, 4:16 PM
82 ↗(On Diff #173037)

The model is pretty different. On COFF, the comdat group has to have a "leader" symbol. All non-leader symbols in the group are included in the final link only if the leader from their object file prevails.

Actually, adding this unique suffix breaks the LLVM IR verifier, since there is a verifier rule that says that the name of a comdat must match some symbol and that symbol must be in the comdat group. Perhaps the comment should explain that.

rnk updated this revision to Diff 173081.Nov 7 2018, 4:29 PM
  • Elaborate on comdats in a comment
This revision is now accepted and ready to land.Nov 7 2018, 4:41 PM
This revision was automatically updated to reflect the committed changes.