[WebAssembly][lld] Don't mark a file live from an undefine symbol

Live symbols should only cause the files in which they are defined
to become live.

For now this is only tested in emscripten: we're continuing
to work on reducing the test case further for an lld-style
unit test.

Differential Revision: https://reviews.llvm.org/D93472
This commit is contained in:
Derek Schuff 2020-12-17 10:25:11 -08:00
parent e1fd202489
commit cb77e877f8

View File

@ -137,7 +137,7 @@ bool Symbol::isLive() const {
void Symbol::markLive() {
assert(!isDiscarded());
if (file != NULL)
if (file != NULL && isDefined())
file->markLive();
if (auto *g = dyn_cast<DefinedGlobal>(this))
g->global->live = true;