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.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/wasm-linker.h b/src/wasm-linker.h
index f6cf832c7..08d6e5f1e 100644
--- a/src/wasm-linker.h
+++ b/src/wasm-linker.h
@@ -24,6 +24,7 @@
#ifndef WASM_WASM_LINK_H
#define WASM_WASM_LINK_H
+#include "support/archive.h"
#include "support/utilities.h"
#include "wasm.h"
@@ -56,7 +57,7 @@ class LinkerObject {
// For now, do not support weak symbols or anything special. Just directly
// merge the functions together, and remove any newly-defined functions
// from undefinedFunction
- void merge(SymbolInfo&& other) {
+ void merge(SymbolInfo& other) {
for (const auto& func : other.implementedFunctions) {
undefinedFunctions.erase(func);
}
@@ -210,8 +211,14 @@ class Linker {
void emscriptenGlue(std::ostream& o);
// Add an object to the link by constructing it in-place with a builder.
+ // Returns false if an error occurred.
bool linkObject(S2WasmBuilder& builder);
+ // Add an archive to the link. Any objects in the archive that satisfy a
+ // currently-undefined reference will be added to the link.
+ // Returns false if an error occurred.
+ bool linkArchive(Archive& archive);
+
private:
// Allocate a static variable and return its address in linear memory
size_t allocateStatic(size_t allocSize, size_t alignment, Name name) {