This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Support weak defined symbols
ClosedPublic

Authored by sbc100 on Jul 5 2017, 1:29 PM.

Details

Summary

Model weakly defined symbols as symbols that are both
exports and imported and marked as weak. Local refereces
to the symbols refer to the import but the linker can
resolve this to the weak export if not strong symbol
is found at link time.

Event Timeline

sbc100 created this revision.Jul 5 2017, 1:29 PM
dschuff accepted this revision.Jul 5 2017, 2:05 PM

One nit, otherwise LGTM. Don't forget to update Linking.md

test/MC/WebAssembly/weak-alias.ll
6

This bitcast is now a no-op, can it be removed?

This revision is now accepted and ready to land.Jul 5 2017, 2:05 PM
sbc100 updated this revision to Diff 105356.Jul 5 2017, 4:36 PM
  • rebase
sbc100 updated this revision to Diff 105357.Jul 5 2017, 4:40 PM
  • remove bitcast
This revision was automatically updated to reflect the committed changes.
mehdi_amini added inline comments.
llvm/trunk/lib/MC/WasmObjectWriter.cpp
932 ↗(On Diff #105576)

You dereferencing Inner after a dynamics cast, it should either be checked or you should use cast.

(I think there are other occurrences to fix in this file).