capsule = V3_Malloc(sizeof(struct v3_sym_capsule));
+
+ if (!capsule) {
+ PrintError("Cannot allocate in initializing symmod\n");
+ return -1;
+ }
+
+
memset(capsule, 0, sizeof(struct v3_sym_capsule));
capsule->name = tmp_def->name;
capsule->guest_size = capsule->size;
capsule->capsule_data = NULL;
} else {
+ V3_Free(capsule)
return -1;
}
(addr_t)(tmp_def->name),
(addr_t)(capsule)) == 0) {
PrintError("Could not insert module %s to master list\n", tmp_def->name);
+ V3_Free(capsule);
return -1;
}
+
list_add(&(capsule->node), &capsule_list);
tmp_def = &(__start__v3_capsules[++i]);
return 0;
}
+int V3_deinit_symmod() {
+ v3_free_htable(capsule_table, 1, 0);
+
+ return 0;
+}
+
/* ***************** */
/* Linkage functions */
/* ***************** */
new_symbol = (struct v3_symbol *)V3_Malloc(sizeof(struct v3_symbol));
+ if (!new_symbol) {
+ PrintError("Cannot allocate in symbiotic hcall handler\n");
+ return -1;
+ }
+
strncpy(new_symbol->name, sym_name, 256);
new_symbol->linkage = tmp_symbol->value;