summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-emscripten.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2020-10-29 11:44:20 -0700
committerGitHub <noreply@github.com>2020-10-29 11:44:20 -0700
commit76f5b362bfc2665196048f8d811f259614db0072 (patch)
tree79f25c01419f8dc613f8c9ca6ebcc75b1838238a /src/wasm/wasm-emscripten.cpp
parent8cd3ad23543b1e6d0c8e5f8a1563ca5f87960645 (diff)
downloadbinaryen-76f5b362bfc2665196048f8d811f259614db0072.tar.gz
binaryen-76f5b362bfc2665196048f8d811f259614db0072.tar.bz2
binaryen-76f5b362bfc2665196048f8d811f259614db0072.zip
Remove support for emscripten legacy PIC ABI (#3299)
Diffstat (limited to 'src/wasm/wasm-emscripten.cpp')
-rw-r--r--src/wasm/wasm-emscripten.cpp42
1 files changed, 0 insertions, 42 deletions
diff --git a/src/wasm/wasm-emscripten.cpp b/src/wasm/wasm-emscripten.cpp
index 7f7b227cf..a1a53af7e 100644
--- a/src/wasm/wasm-emscripten.cpp
+++ b/src/wasm/wasm-emscripten.cpp
@@ -38,7 +38,6 @@ cashew::IString EM_ASM_PREFIX("emscripten_asm_const");
cashew::IString EM_JS_PREFIX("__em_js__");
static Name STACK_INIT("stack$init");
-static Name POST_INSTANTIATE("__post_instantiate");
void addExportedFunction(Module& wasm, Function* function) {
wasm.addFunction(function);
@@ -75,47 +74,6 @@ Global* getStackPointerGlobal(Module& wasm) {
return nullptr;
}
-// For emscripten SIDE_MODULE we generate a single exported function called
-// __post_instantiate which calls two functions:
-//
-// - __assign_got_enties
-// - __wasm_call_ctors
-//
-// The former is function we generate here which calls imported g$XXX functions
-// order to assign values to any globals imported from GOT.func or GOT.mem.
-// These globals hold address of functions and globals respectively.
-//
-// The later is the constructor function generaed by lld which performs any
-// fixups on the memory section and calls static constructors.
-void EmscriptenGlueGenerator::generatePostInstantiateFunction() {
- BYN_TRACE("generatePostInstantiateFunction\n");
- Builder builder(wasm);
- Function* post_instantiate = builder.makeFunction(
- POST_INSTANTIATE, std::vector<NameType>{}, Type::none, {});
- wasm.addFunction(post_instantiate);
-
- if (Function* F = wasm.getFunctionOrNull(ASSIGN_GOT_ENTRIES)) {
- // call __assign_got_enties from post_instantiate
- Expression* call = builder.makeCall(F->name, {}, Type::none);
- post_instantiate->body = builder.blockify(post_instantiate->body, call);
- }
-
- // The names of standard imports/exports used by lld doesn't quite match that
- // expected by emscripten.
- // TODO(sbc): Unify these
- if (auto* e = wasm.getExportOrNull(WASM_CALL_CTORS)) {
- Expression* call = builder.makeCall(e->value, {}, Type::none);
- post_instantiate->body = builder.blockify(post_instantiate->body, call);
- wasm.removeExport(WASM_CALL_CTORS);
- }
-
- auto* ex = new Export();
- ex->value = post_instantiate->name;
- ex->name = POST_INSTANTIATE;
- ex->kind = ExternalKind::Function;
- wasm.addExport(ex);
-}
-
const Address UNKNOWN_OFFSET(uint32_t(-1));
std::vector<Address> getSegmentOffsets(Module& wasm) {