fix: patch correct payload offset value in relocation

Related-To:: GSD-8116
Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
Maciej Plewka
2024-05-20 13:28:15 +00:00
committed by Compute-Runtime-Automation
parent 63843862df
commit b755a30919
2 changed files with 6 additions and 3 deletions

View File

@@ -440,7 +440,8 @@ void Linker::patchInstructionsSegments(const std::vector<PatchableSegment> &inst
auto relocAddress = ptrOffset(segment.hostPointer, static_cast<uintptr_t>(relocation.offset));
if (relocation.type == LinkerInput::RelocationInfo::Type::perThreadPayloadOffset) {
*reinterpret_cast<uint32_t *>(relocAddress) = kernelDescriptors.at(segId)->kernelAttributes.crossThreadDataSize;
uint32_t crossThreadDataSize = kernelDescriptors.at(segId)->kernelAttributes.crossThreadDataSize - kernelDescriptors.at(segId)->kernelAttributes.inlineDataPayloadSize;
*reinterpret_cast<uint32_t *>(relocAddress) = crossThreadDataSize;
} else if (relocation.symbolName == implicitArgsRelocationSymbolName) {
pImplicitArgsRelocationAddresses[static_cast<uint32_t>(segId)].push_back(reinterpret_cast<uint32_t *>(relocAddress));
} else if (relocation.symbolName.empty()) {