This is an archive of the discontinued LLVM Phabricator instance.

[MC] [COFF] Make sure that weak external symbols are undefined symbols
ClosedPublic

Authored by mstorsjo on Jul 24 2020, 3:42 AM.

Details

Summary

For comdats (e.g. caused by -ffunction-sections), Section is already set here; make sure it's null, for the weak external symbol to be undefined.

This fixes PR46779.

This setup did reveal another issue wrt mingw style associative comdats in combination with weak symbols, when the actual leader symbol isn't named func but .weak.func.default in these cases. I'm looking at ways of fixing that as well (as a general headsup re potentially getting the fix for that into the release as well).

Diff Detail

Event Timeline

mstorsjo created this revision.Jul 24 2020, 3:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 24 2020, 3:42 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
hans accepted this revision.Jul 24 2020, 4:27 AM
This revision is now accepted and ready to land.Jul 24 2020, 4:27 AM
This revision was automatically updated to reflect the committed changes.