From 60f86d614792fc6177def54d8049a19ee4e5218e Mon Sep 17 00:00:00 2001 From: Maschell Date: Tue, 3 Jan 2023 22:02:45 +0100 Subject: [PATCH] Improve the error message when a imported module is missing an export --- wumsloader/src/utils/RelocationUtils.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wumsloader/src/utils/RelocationUtils.cpp b/wumsloader/src/utils/RelocationUtils.cpp index cbc348c..2c9f460 100644 --- a/wumsloader/src/utils/RelocationUtils.cpp +++ b/wumsloader/src/utils/RelocationUtils.cpp @@ -87,11 +87,17 @@ bool doRelocation(const std::vector> &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."); + } } }