summaryrefslogtreecommitdiff
path: root/src/wasm-link.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm-link.h')
-rw-r--r--src/wasm-link.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/wasm-link.h b/src/wasm-link.h
index 2fdc33ac..86cdecb5 100644
--- a/src/wasm-link.h
+++ b/src/wasm-link.h
@@ -26,7 +26,7 @@
namespace wabt {
namespace link {
-struct LinkerInputBinary;
+class LinkerInputBinary;
struct FunctionImport {
StringSlice module_name;
@@ -34,7 +34,7 @@ struct FunctionImport {
Index sig_index;
bool active; /* Is this import present in the linked binary */
Index relocated_function_index;
- struct LinkerInputBinary* foreign_binary;
+ LinkerInputBinary* foreign_binary;
Index foreign_index;
};
@@ -69,7 +69,7 @@ struct Section {
~Section();
/* The binary to which this section belongs */
- struct LinkerInputBinary* binary;
+ LinkerInputBinary* binary;
std::vector<Reloc> relocations; /* The relocations for this section */
BinarySection section_code;
@@ -98,11 +98,20 @@ struct Section {
typedef std::vector<Section*> SectionPtrVector;
-struct LinkerInputBinary {
+class LinkerInputBinary {
+ public:
WABT_DISALLOW_COPY_AND_ASSIGN(LinkerInputBinary);
LinkerInputBinary(const char* filename, uint8_t* data, size_t size);
~LinkerInputBinary();
+ Index RelocateFuncIndex(Index findex);
+ Index RelocateTypeIndex(Index index);
+ Index RelocateGlobalIndex(Index index);
+
+ bool IsValidFunctionIndex(Index index);
+ bool IsFunctionImport(Index index);
+ bool IsInactiveFunctionImport(Index index);
+
const char* filename;
uint8_t* data;
size_t size;
@@ -123,7 +132,8 @@ struct LinkerInputBinary {
Index memory_page_count;
Index memory_page_offset;
- Index table_elem_count;
+ Index table_elem_count = 0;
+ Index function_count = 0;
std::vector<std::string> debug_names;
};