This is an archive of the discontinued LLVM Phabricator instance.

[RuntimeDyld][COFF] Build stubs for COFF dllimport symbols.
ClosedPublic

Authored by lhames on Mar 9 2020, 5:23 PM.

Details

Summary

Enables JIT-linking by RuntimeDyld of COFF objects that contain references to
dllimport symbols. This is done by recognizing symbols that start with the
reserved "imp_" prefix and building a pointer entry to the target symbol in
the stubs area of the section. References to the "
imp_" symbol are updated to
point to this pointer.

Work in progress: The generic code is in place, but only RuntimeDyldCOFFX86_64
and RuntimeDyldCOFFI386 have been updated to look for and update references to
dllimport symbols.

Diff Detail

Event Timeline

lhames created this revision.Mar 9 2020, 5:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 9 2020, 5:23 PM
compnerd accepted this revision.Mar 9 2020, 11:25 PM

LGTM, and tested with Swift as well that it does resolve the issue. Thanks for fixing this!

This revision is now accepted and ready to land.Mar 9 2020, 11:25 PM
This revision was automatically updated to reflect the committed changes.