linker: handle relocation for exported modules (#2247)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / linux-qt-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions

This commit is contained in:
panzone91 2025-01-27 21:40:58 +01:00 committed by GitHub
parent 665261efc5
commit 2837d848ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -109,10 +109,13 @@ public:
void RelocateAnyImports(Module* m) {
Relocate(m);
for (auto& module : m_modules) {
const auto imports = module->GetImportModules();
if (std::ranges::contains(imports, m->name, &ModuleInfo::name)) {
Relocate(module.get());
const auto exports = m->GetExportModules();
for (auto& export_mod : exports) {
for (auto& module : m_modules) {
const auto imports = module->GetImportModules();
if (std::ranges::contains(imports, export_mod.name, &ModuleInfo::name)) {
Relocate(module.get());
}
}
}
}