This is an archive of the discontinued LLVM Phabricator instance.

[lld/mac] Don't assert when using -exported_symbol with private symbol
ClosedPublic

Authored by thakis on Apr 23 2021, 8:00 PM.

Details

Summary

When I added this assert in D93609, it asserted that a symbol that
is privateExtern is also isExternal().

In D98381 the privateExtern check moved into shouldExportSymbol()
but the assert didn't -- now it checked that _every_ non-exported
symbol is isExternal(), which isn't true. Move the assert into the
privateExtern check where it used to be.

Fixes PR50098.

Diff Detail

Event Timeline

thakis created this revision.Apr 23 2021, 8:00 PM
Herald added a project: Restricted Project. · View Herald Transcript
thakis requested review of this revision.Apr 23 2021, 8:00 PM
int3 accepted this revision.Apr 23 2021, 9:02 PM

How about removing the assert altogether? InputFiles.cpp already has assert((sym.n_type & N_EXT) && "invalid input");

Keeping it is fine too I guess since it's a debug build only thing

This revision is now accepted and ready to land.Apr 23 2021, 9:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 24 2021, 7:22 AM