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

Authored by sbc100 on Fri, Jan 12, 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
sbc100 created this revision.Fri, Jan 12, 11:07 AM
sbc100 edited the summary of this revision. (Show Details)Fri, Jan 12, 11:08 AM
sbc100 added reviewers: ruiu, ncw, dschuff.
ruiu added inline comments.Fri, Jan 12, 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.Fri, Jan 12, 1:55 PM
  • feedback
sbc100 added inline comments.Fri, Jan 12, 1:55 PM
wasm/Driver.cpp
333

Ok, fixed here and elsewhere in this file.

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

LGTM

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