summaryrefslogtreecommitdiff
path: root/src/wasm-linker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm-linker.cpp')
-rw-r--r--src/wasm-linker.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wasm-linker.cpp b/src/wasm-linker.cpp
index 56ec03851..76bf8942d 100644
--- a/src/wasm-linker.cpp
+++ b/src/wasm-linker.cpp
@@ -40,7 +40,9 @@ void Linker::placeStackPointer(Address stackAllocation) {
// stack pointer to point to one past-the-end of the stack allocation.
std::vector<char> raw;
raw.resize(pointerSize);
- out.addRelocation(LinkerObject::Relocation::kData, (uint32_t*)&raw[0], ".stack", stackAllocation);
+ auto relocation = new LinkerObject::Relocation(
+ LinkerObject::Relocation::kData, (uint32_t*)&raw[0], ".stack", stackAllocation);
+ out.addRelocation(relocation);
assert(out.wasm.memory.segments.empty());
out.addSegment("__stack_pointer", raw);
}
@@ -327,6 +329,8 @@ void Linker::emscriptenGlue(std::ostream& o) {
exportFunction(f->name, true);
}
+ emscripten::addObjectImports(out.wasm, out.symbolInfo.importedObjects);
+
auto staticBump = nextStatic - globalBase;
emscripten::generateEmscriptenMetadata(o, out.wasm, segmentsByAddress, staticBump, out.initializerFunctions);
}