Improve the error message when a imported module is missing an export

This commit is contained in:
Maschell 2023-01-03 22:02:45 +01:00
parent d6ec92c767
commit 60f86d6147

View File

@ -87,11 +87,17 @@ bool doRelocation(const std::vector<std::shared_ptr<ModuleData>> &moduleList,
for (auto &module : moduleList) {
if (rplName == module->getExportName()) {
auto found = false;
for (auto &exportData : module->getExportDataList()) {
if (functionName == exportData->getName()) {
functionAddress = (uint32_t) exportData->getAddress();
found = true;
}
}
if (!found) {
DEBUG_FUNCTION_LINE_ERR("Failed to find export %s of module: %s", functionName.c_str(), rplName.c_str());
OSFatal("Failed to find export of module.");
}
}
}