This is an archive of the discontinued LLVM Phabricator instance.

[lld][WebAssembly] Handle weakly defined symbols in shared libraries.
ClosedPublic

Authored by sbc100 on Aug 19 2021, 2:52 PM.

Details

Summary

In the case of weakly defined symbols in shared libraries we now
generate both an import and an export. The dynamic linker can then
choose how a winner from among all the DSOs that define a
given symbol.

Previously any direct usage of a weakly defined symbol would use the
DSO-local definition (For example, even through there would be single
address for a weakly defined function, each DSO could end up directly
calling its local version).

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

Diff Detail

Event Timeline

sbc100 created this revision.Aug 19 2021, 2:52 PM
sbc100 requested review of this revision.Aug 19 2021, 2:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 19 2021, 2:52 PM
sbc100 edited the summary of this revision. (Show Details)Aug 19 2021, 3:27 PM
sbc100 added a reviewer: dschuff.
sbc100 updated this revision to Diff 367634.Aug 19 2021, 3:31 PM
  • comment
dschuff accepted this revision.Aug 19 2021, 4:22 PM
This revision is now accepted and ready to land.Aug 19 2021, 4:22 PM
This revision was landed with ongoing or failed builds.Aug 19 2021, 4:26 PM
This revision was automatically updated to reflect the committed changes.