[lld/mac] Don't assert when using -exported_symbol with private symbol
authorNico Weber <thakis@chromium.org>
Sat, 24 Apr 2021 02:55:05 +0000 (22:55 -0400)
committerNico Weber <thakis@chromium.org>
Sat, 24 Apr 2021 14:21:51 +0000 (10:21 -0400)
commitde266ce4f9f2dfc989d2f9f82017229be5f535eb
tree71c0ced2e492affcccd4c7a6cdd81a6f30f4ce27
parent7402ec8f3877e061a6559c44262ec4d951d12cc7
[lld/mac] Don't assert when using -exported_symbol with private symbol

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.

Differential Revision: https://reviews.llvm.org/D101223
lld/MachO/SyntheticSections.cpp
lld/test/MachO/export-options.s