This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Fix bug handling hidden comdat symbols
ClosedPublic

Authored by sbc100 on Jul 17 2019, 10:26 AM.

Details

Summary

When hidden symbols are discarded by comdat rules we still want to
create a local defined symbol, otherwise Symbol::isDiscarded() relies on
begin able to check getChunk->discarded.

This is a follow up on rL362769. The comdat.ll test was previously
GC'ing the __wasm_call_ctors functions so the do_init function was
not actually being included in the link. Once hat function was
included in triggered that crash bug this change fixes.

Fixes: https://github.com/emscripten-core/emscripten/issues/8981

Event Timeline

sbc100 created this revision.Jul 17 2019, 10:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 17 2019, 10:26 AM
sbc100 retitled this revision from [WebAssembly] Fix bug handling of comdat functions in init array. to [WebAssembly] Fix bug handling hidden comdat symbols.Jul 17 2019, 10:33 AM
sbc100 edited the summary of this revision. (Show Details)
sbc100 added reviewers: ruiu, azakai.
kripken accepted this revision.Jul 17 2019, 11:21 AM

I'm not an expert on this but it looks right to me.

This revision is now accepted and ready to land.Jul 17 2019, 11:21 AM
This revision was automatically updated to reflect the committed changes.