This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Model weak aliases as wasm exports
ClosedPublic

Authored by sbc100 on Sep 25 2017, 12:22 PM.

Details

Summary

Previouly these were being included as both imports and
exports, with the import being satisfied by the export
(or some strong symbol) at runtime. However this proved
unnecesary and actually complicated linking as it meant
there was not a 1-to-1 mapping between a wasm function
/global index and a linker symbol.

Diff Detail

Repository
rL LLVM

Event Timeline

sbc100 created this revision.Sep 25 2017, 12:22 PM
sbc100 added a subscriber: llvm-commits.
sbc100 retitled this revision from [WebAssembly] Model weakly defined symbols as wasm exports to [WebAssembly] Model weak aliases as wasm exports.Sep 25 2017, 2:59 PM
sbc100 edited the summary of this revision. (Show Details)
dschuff added inline comments.Sep 26 2017, 8:51 AM
lib/Object/WasmObjectFile.cpp
340 ↗(On Diff #116586)

I just remembered that try_emplace is a C++17 function, so it may not be in the stdlib on all supported LLVM platforms; we should probably switch to something else.

dschuff accepted this revision.Sep 26 2017, 9:22 AM

That can be a separate change though.
Is this in tool-conventions yet? If so, should update.

This revision is now accepted and ready to land.Sep 26 2017, 9:22 AM
sbc100 added inline comments.Sep 26 2017, 12:12 PM
lib/Object/WasmObjectFile.cpp
340 ↗(On Diff #116586)

Its been in here for months now.. so at least there are not bots that can't build this.

Oh I see, this is a StringMap which does define its own try_emplace() method.. so we should be fine.

This revision was automatically updated to reflect the committed changes.