This is an archive of the discontinued LLVM Phabricator instance.

[JITLink][COFF] Implement IMAGE_COMDAT_SELECT_LARGEST partially.
ClosedPublic

Authored by sunho on Jul 16 2022, 1:13 PM.

Details

Summary

Implement IMAGE_COMDAT_SELECT_LARGEST partially. It's going to fail if larger symbol appears but this hasn't happened at least in vcruntime library.

We probably would not implement this properly as it requires complicated runtime patching which is not of nature of JIT. However, we'd like to validate if larger section appears and report to the user in the near future.

Diff Detail

Event Timeline

sunho created this revision.Jul 16 2022, 1:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 16 2022, 1:13 PM
sunho requested review of this revision.Jul 16 2022, 1:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 16 2022, 1:13 PM
sunho retitled this revision from [JITLink][COFF] Implement IMAGE_COMDAT_SELECT_LARGEST. to [JITLink][COFF] Implement IMAGE_COMDAT_SELECT_LARGEST partially..Jul 16 2022, 1:55 PM
sunho updated this revision to Diff 445741.Jul 19 2022, 2:06 AM
lhames accepted this revision.Jul 25 2022, 2:51 PM

LGTM, at least as an initial step to bring up COFF support.

So the MSVC runtime requires this? Do you know what kind of symbols the runtime uses IMAGE_COMDAT_SELECT_LARGEST for? C common symbols?

This revision is now accepted and ready to land.Jul 25 2022, 2:51 PM
sunho added a comment.Jul 25 2022, 8:26 PM

@lhames Almost all comdat symbols in vc runtime uses largest selection type. I don't really see size difference between symbols thought, maybe it was to deal with backwards compatibility.

This revision was landed with ongoing or failed builds.Jul 25 2022, 8:52 PM
This revision was automatically updated to reflect the committed changes.