summaryrefslogtreecommitdiff
path: root/src/wasm-linker.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm-linker.h')
-rw-r--r--src/wasm-linker.h27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/wasm-linker.h b/src/wasm-linker.h
index 4a0e1e0b9..3660b3038 100644
--- a/src/wasm-linker.h
+++ b/src/wasm-linker.h
@@ -193,18 +193,18 @@ class LinkerObject {
// applying the relocations, resulting in an executable wasm module.
class Linker {
public:
- Linker(Address globalBase, Address stackAllocation,
- Address userInitialMemory, Address userMaxMemory,
- bool ignoreUnknownSymbols, Name startFunction,
- bool debug) :
- ignoreUnknownSymbols(ignoreUnknownSymbols),
- startFunction(startFunction),
- globalBase(globalBase),
- nextStatic(globalBase),
- userInitialMemory(userInitialMemory),
- userMaxMemory(userMaxMemory),
- stackAllocation(stackAllocation),
- debug(debug) {
+ Linker(Address globalBase, Address stackAllocation, Address userInitialMemory,
+ Address userMaxMemory, bool importMemory, bool ignoreUnknownSymbols,
+ Name startFunction, bool debug)
+ : ignoreUnknownSymbols(ignoreUnknownSymbols),
+ startFunction(startFunction),
+ globalBase(globalBase),
+ nextStatic(globalBase),
+ userInitialMemory(userInitialMemory),
+ userMaxMemory(userMaxMemory),
+ importMemory(importMemory),
+ stackAllocation(stackAllocation),
+ debug(debug) {
if (userMaxMemory && userMaxMemory < userInitialMemory) {
Fatal() << "Specified max memory " << userMaxMemory <<
" is < specified initial memory " << userInitialMemory;
@@ -217,6 +217,7 @@ class Linker {
Fatal() << "Specified initial memory " << userInitialMemory <<
" is not a multiple of 64k";
}
+
// Don't allow anything to be allocated at address 0
if (globalBase == 0) nextStatic = 1;
@@ -312,6 +313,8 @@ class Linker {
Address userInitialMemory; // Initial memory size (in bytes) specified by the user.
Address userMaxMemory; // Max memory size (in bytes) specified by the user.
//(after linking, this is rounded and set on the wasm object in pages)
+ bool importMemory; // Whether the memory should be imported instead of
+ // defined.
Address stackAllocation;
bool debug;