| ... |
... |
@@ -784,21 +784,22 @@ class DyLD { |
|
784
|
784
|
continue;
|
|
785
|
785
|
}
|
|
786
|
786
|
|
|
787
|
|
- // See
|
|
788
|
|
- // https://gitlab.haskell.org/haskell-wasm/llvm-project/-/blob/release/21.x/lld/wasm/Writer.cpp#L1451,
|
|
789
|
|
- // __wasm_apply_data_relocs is now optional so only call it if
|
|
790
|
|
- // it exists (we know for sure it exists for libc.so though).
|
|
791
|
|
- // There's also __wasm_init_memory (not relevant yet, we don't
|
|
792
|
|
- // use passive segments) & __wasm_apply_global_relocs but
|
|
793
|
|
- // those are included in the start function and should have
|
|
794
|
|
- // been called upon instantiation, see
|
|
795
|
|
- // Writer::createStartFunction().
|
|
796
|
|
- if (instance.exports.__wasm_apply_data_relocs) {
|
|
|
787
|
+ const init = () => {
|
|
|
788
|
+ // See
|
|
|
789
|
+ // https://gitlab.haskell.org/haskell-wasm/llvm-project/-/blob/release/21.x/lld/wasm/Writer.cpp#L1451,
|
|
|
790
|
+ // __wasm_apply_data_relocs is now optional so only call it if
|
|
|
791
|
+ // it exists (we know for sure it exists for libc.so though).
|
|
|
792
|
+ // There's also __wasm_init_memory (not relevant yet, we don't
|
|
|
793
|
+ // use passive segments) & __wasm_apply_global_relocs but
|
|
|
794
|
+ // those are included in the start function and should have
|
|
|
795
|
+ // been called upon instantiation, see
|
|
|
796
|
+ // Writer::createStartFunction().
|
|
|
797
|
+ if (instance.exports.__wasm_apply_data_relocs) {
|
|
797
|
798
|
instance.exports.__wasm_apply_data_relocs();
|
|
798
|
799
|
}
|
|
799
|
|
- };
|
|
800
|
800
|
|
|
801
|
|
- instance.exports._initialize();
|
|
|
801
|
+ instance.exports._initialize();
|
|
|
802
|
+ };
|
|
802
|
803
|
|
|
803
|
804
|
// rts init must be deferred until ghc-internal symbols are
|
|
804
|
805
|
// exported. We hard code this hack for now.
|