PPU LLVM: don't use module name as PRX indicator

This commit is contained in:
Nekotekina 2021-01-28 14:22:49 +03:00
parent 8a029159cd
commit c89362f6a2
2 changed files with 3 additions and 3 deletions

View file

@ -2561,7 +2561,7 @@ bool ppu_initialize(const ppu_module& info, bool check_only)
usz fpos = 0;
// Difference between function name and current location
const u32 reloc = info.name.empty() ? 0 : info.segs.at(0).addr;
const u32 reloc = info.relocs.empty() ? 0 : info.segs.at(0).addr;
// Info sent to threads
std::vector<std::pair<std::string, ppu_module>> workload;

View file

@ -27,7 +27,7 @@ PPUTranslator::PPUTranslator(LLVMContext& context, Module* _module, const ppu_mo
cpu_translator::initialize(context, engine);
// There is no weak linkage on JIT, so let's create variables with different names for each module part
const u32 gsuffix = m_info.name.empty() ? info.funcs[0].addr : info.funcs[0].addr - m_info.segs[0].addr;
const u32 gsuffix = m_info.relocs.empty() ? info.funcs[0].addr : info.funcs[0].addr - m_info.segs[0].addr;
// Memory base
m_base = new GlobalVariable(*_module, ArrayType::get(GetType<char>(), 0x100000000)->getPointerTo(), true, GlobalValue::ExternalLinkage, 0, fmt::format("__mptr%x", gsuffix));
@ -130,7 +130,7 @@ PPUTranslator::PPUTranslator(LLVMContext& context, Module* _module, const ppu_mo
}
}
if (!m_info.name.empty())
if (!m_info.relocs.empty())
{
m_reloc = &m_info.segs[0];
}