This is an archive of the discontinued LLVM Phabricator instance.

[lld][WebAssembly] Handle weakly referenced symbols when lazy (archive) version is see first
ClosedPublic

Authored by sbc100 on Aug 7 2020, 4:15 PM.

Details

Summary

When a weak reference of a lazy synmbol occurs we were not correctly
updating the lazy symbol. We need to tag the existing lazy symbol
as weak and, in the case of a function symbol, give it a signature.

Without the signature we can't then create the dummy function which
is needed when an weakly undefined function is called.

We had tests for weakly referenced lazy symbols but we were only
tests in the case where the reference was seen before the lazy
symbol.

See: https://github.com/WebAssembly/wasi-libc/pull/214

Diff Detail

Event Timeline

sbc100 created this revision.Aug 7 2020, 4:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 7 2020, 4:15 PM
sbc100 requested review of this revision.Aug 7 2020, 4:15 PM
sbc100 retitled this revision from Handle undefined weak sumbols even when lazy version is loaded first to Handle undefined weak symbols even when lazy version is loaded first.Aug 7 2020, 4:16 PM
sbc100 added reviewers: alexcrichton, dschuff.
sbc100 retitled this revision from Handle undefined weak symbols even when lazy version is loaded first to [lld][WebAssembly] Handle weakly referenced symbols when lazy (archive) version is see first.
alexcrichton accepted this revision.Aug 9 2020, 4:53 PM

Nice find!

This revision is now accepted and ready to land.Aug 9 2020, 4:53 PM
This revision was landed with ongoing or failed builds.Aug 10 2020, 8:17 AM
This revision was automatically updated to reflect the committed changes.