This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Add --export flag to force a symbol to be exported
ClosedPublic

Authored by sbc100 on Jan 12 2018, 11:07 AM.

Details

Summary

This is useful for emscripten or other tools that want to
selectively exports symbols without necessarily changing the
source code.

In particular it can be useful to export __wasm_call_ctors and
call it from the outside.

Diff Detail

Repository
rLLD LLVM Linker

Event Timeline

sbc100 created this revision.Jan 12 2018, 11:07 AM
sbc100 edited the summary of this revision. (Show Details)Jan 12 2018, 11:08 AM
sbc100 added reviewers: ruiu, ncw, dschuff.
ruiu added inline comments.Jan 12 2018, 11:56 AM
wasm/Driver.cpp
333

This is more common way of doing the same thing:

for (auto *Arg : Args.filter(OPT_export)) {
  // use Arg->getValue() instead of S
}
sbc100 updated this revision to Diff 129702.Jan 12 2018, 1:55 PM
  • feedback
sbc100 added inline comments.Jan 12 2018, 1:55 PM
wasm/Driver.cpp
333

Ok, fixed here and elsewhere in this file.

ruiu accepted this revision.Jan 12 2018, 1:59 PM

LGTM

This revision is now accepted and ready to land.Jan 12 2018, 1:59 PM
This revision was automatically updated to reflect the committed changes.