From 76f5b362bfc2665196048f8d811f259614db0072 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Thu, 29 Oct 2020 11:44:20 -0700 Subject: Remove support for emscripten legacy PIC ABI (#3299) --- src/wasm/wasm-emscripten.cpp | 42 ------------------------------------------ 1 file changed, 42 deletions(-) (limited to 'src/wasm/wasm-emscripten.cpp') 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{}, 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
getSegmentOffsets(Module& wasm) { -- cgit v1.2.3