We already perform memory initialization and apply global relocations
during start. It makes sense to performs data relocations too. I think
the reason we were not doing this already is solely historical.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Who was previously responsible for applying the data relocs? If it was Emscripten runtime code, does that mean this change will have to land alongside the corresponding Emscripten change? Is there anyone who would be broken by this ABI break who we should notify?
lld/wasm/Writer.cpp | ||
---|---|---|
1267–1274 | Can we add a test that exercises this case? |
Previously it was treated as the very first ctor in __wasm_call_ctors.. (which emscripten take care of calling). Now it happens earlier, removing that window where the relocations have not yet been applied.
lld/wasm/Writer.cpp | ||
---|---|---|
1267–1274 | I think we have coverage of all three branches above now. |
This change (probably) broke the SAFE_HEAP tests on the emscripten waterfall: https://logs.chromium.org/logs/emscripten-releases/buildbucket/cr-buildbucket/8824622360264175889/+/u/Emscripten_testsuite__SAFE_HEAP_/stdout
There are other changes in the LLVM roll (https://chromium.googlesource.com/emscripten-releases/+/cd22f208c7dda41d695549e17f8ddc4ae533769d) but this is the only wasm-related one.
Yup.. I noticed that too. Fix is in https://github.com/WebAssembly/binaryen/pull/4463
Can we add a test that exercises this case?