diff options
author | Sam Clegg <sbc@chromium.org> | 2020-10-18 12:08:43 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-18 10:08:43 -0700 |
commit | 056870687abaa7ff9cd887a8fcf13bba1ccfa203 (patch) | |
tree | d943feddf7d50a2457e078920e26f4df96287d3c /src/wasm | |
parent | 8cdb2eaa7cb3f4c693239e32fe4d4c7f3d75e005 (diff) | |
download | binaryen-056870687abaa7ff9cd887a8fcf13bba1ccfa203.tar.gz binaryen-056870687abaa7ff9cd887a8fcf13bba1ccfa203.tar.bz2 binaryen-056870687abaa7ff9cd887a8fcf13bba1ccfa203.zip |
Remove now-redundant stack pointer manipulation passes (#3251)
The use of these passes was removed on the emscripten side
in https://github.com/emscripten-core/emscripten/pull/12536.
Diffstat (limited to 'src/wasm')
-rw-r--r-- | src/wasm/wasm-emscripten.cpp | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/src/wasm/wasm-emscripten.cpp b/src/wasm/wasm-emscripten.cpp index dec824331..7f7b227cf 100644 --- a/src/wasm/wasm-emscripten.cpp +++ b/src/wasm/wasm-emscripten.cpp @@ -116,32 +116,6 @@ void EmscriptenGlueGenerator::generatePostInstantiateFunction() { wasm.addExport(ex); } -// lld can sometimes produce a build with an imported mutable __stack_pointer -// (i.e. when linking with -fpie). This method internalizes the -// __stack_pointer and initializes it from an immutable global instead. -// For -shared builds we instead call replaceStackPointerGlobal. -void EmscriptenGlueGenerator::internalizeStackPointerGlobal() { - Global* stackPointer = getStackPointerGlobal(wasm); - if (!stackPointer || !stackPointer->imported() || !stackPointer->mutable_) { - return; - } - - Name internalName = stackPointer->name; - Name externalName = internalName.c_str() + std::string("_import"); - - // Rename the imported global, and make it immutable - stackPointer->name = externalName; - stackPointer->mutable_ = false; - wasm.updateMaps(); - - // Create a new global with the old name that is not imported. - Builder builder(wasm); - auto* init = builder.makeGlobalGet(externalName, stackPointer->type); - auto* sp = builder.makeGlobal( - internalName, stackPointer->type, init, Builder::Mutable); - wasm.addGlobal(sp); -} - const Address UNKNOWN_OFFSET(uint32_t(-1)); std::vector<Address> getSegmentOffsets(Module& wasm) { |