diff options
author | Alon Zakai <azakai@google.com> | 2020-09-03 08:06:22 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-03 08:06:22 -0700 |
commit | 560baeea1810e7e4a0da6155be6e3dc9716a6758 (patch) | |
tree | 51dd8858a9f08b2334ae019e93a5dfd7469347f8 /src/tools | |
parent | 5effd0d06cceb25c75a561b505a4e6a23ce0bab2 (diff) | |
download | binaryen-560baeea1810e7e4a0da6155be6e3dc9716a6758.tar.gz binaryen-560baeea1810e7e4a0da6155be6e3dc9716a6758.tar.bz2 binaryen-560baeea1810e7e4a0da6155be6e3dc9716a6758.zip |
wasm-emscripten-finalize: Don't rename the imported table (#3101)
When minimizing wasm changes, leave it as __indirect_function_table
which is what LLVM emits.
This also removes the renaming of the memory. That was never needed
as LLVM already emits "memory" there.
See #3043
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/wasm-emscripten-finalize.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/tools/wasm-emscripten-finalize.cpp b/src/tools/wasm-emscripten-finalize.cpp index 49f8beabf..cdba9a9d4 100644 --- a/src/tools/wasm-emscripten-finalize.cpp +++ b/src/tools/wasm-emscripten-finalize.cpp @@ -255,15 +255,10 @@ int main(int argc, const char* argv[]) { std::vector<Name> initializerFunctions; - if (wasm.table.imported()) { - if (wasm.table.base != "table") { - wasm.table.base = Name("table"); - } - } - if (wasm.memory.imported()) { - if (wasm.table.base != "memory") { - wasm.memory.base = Name("memory"); - } + // The wasm backend emits "__indirect_function_table" as the import name for + // the table, while older emscripten expects "table" + if (wasm.table.imported() && !minimizeWasmChanges) { + wasm.table.base = Name("table"); } wasm.updateMaps(); |