This is an archive of the discontinued LLVM Phabricator instance.

[LLD] [COFF] Fix automatically importing data symbols from DLLs with LTO
ClosedPublic

Authored by mstorsjo on Nov 12 2019, 11:50 PM.

Details

Summary

This broke in 51dcb292cc002, "[lld-link] diagnose undefined symbols before LTO when possible" (very soon after the 9.0 branch, so luckily the 9.0 release is unaffected).

The code for loading objects we believe might be needed for autoimport (loadMinGWAutomaticImports()) does run before the new reportUnresolvable() function, but it had a condition to only operate on symbols from regular object files. This condition came from resolveRemainingUndefines(), but as loadMinGWAutomaticImports() now has to operate before the LTO, it has to operate on undefineds from LTO objects as well.

Diff Detail

Event Timeline

mstorsjo created this revision.Nov 12 2019, 11:50 PM
rnk accepted this revision.Nov 13 2019, 9:53 AM

lgtm

This revision is now accepted and ready to land.Nov 13 2019, 9:53 AM
This revision was automatically updated to reflect the committed changes.