This is an archive of the discontinued LLVM Phabricator instance.

[lld/mac] Don't assert during thunk insertion if there are undefined symbols
ClosedPublic

Authored by thakis on Sep 1 2021, 11:31 AM.

Details

Summary

We end up calling resolveBranchVA(), which asserts for Undefineds.

As fix, just return early in Writer::run() if there are any diagnostics
after processing relocations (which is where undefined symbol errors are
emitted). This matches what the ELF port does.

Diff Detail

Event Timeline

thakis created this revision.Sep 1 2021, 11:31 AM
Herald added a project: Restricted Project. · View Herald Transcript
thakis requested review of this revision.Sep 1 2021, 11:31 AM
thakis updated this revision to Diff 369999.Sep 1 2021, 11:33 AM

include code change too, not just test 😅

int3 accepted this revision.Sep 3 2021, 8:43 AM
int3 added a subscriber: int3.

whoops, forgot about this. lgtm!

This revision is now accepted and ready to land.Sep 3 2021, 8:43 AM
This revision was landed with ongoing or failed builds.Sep 3 2021, 9:23 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 3 2021, 9:23 AM