From 02441dab81b15ccb3ecd890547396e8c13fa2d11 Mon Sep 17 00:00:00 2001 From: Maschell Date: Fri, 29 May 2020 17:31:53 +0200 Subject: [PATCH] relocator: Add missing ExportData loading for ModuleData in persistence --- relocator/src/ModuleDataPersistence.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/relocator/src/ModuleDataPersistence.cpp b/relocator/src/ModuleDataPersistence.cpp index 5b09178..c707d40 100644 --- a/relocator/src/ModuleDataPersistence.cpp +++ b/relocator/src/ModuleDataPersistence.cpp @@ -4,6 +4,7 @@ #include "../../source/module/ModuleData.h" #include "../../source/module/RelocationData.h" #include +#include std::vector ModuleDataPersistence::loadModuleData(module_information_t *moduleInformation) { std::vector result; @@ -34,6 +35,14 @@ std::vector ModuleDataPersistence::loadModuleData(module_information moduleData.setExportName(module_data->module_export_name); + + for (uint32_t j = 0; j < EXPORT_ENTRY_LIST_LENGTH; j++) { + export_data_t *export_entry = &(module_data->export_entries[j]); + if (export_entry->address == NULL) { + continue; + } + moduleData.addExportData(ExportData(static_cast(export_entry->type), export_entry->name, reinterpret_cast(export_entry->address))); + } for (uint32_t j = 0; j < DYN_LINK_RELOCATION_LIST_LENGTH; j++) { dyn_linking_relocation_entry_t *linking_entry = &(module_data->linking_entries[j]); if (linking_entry->destination == NULL) {