Zebin: Use strings section for printf

Resolves: NEO-6143

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
This commit is contained in:
Krystian Chmielewski
2021-11-02 15:29:09 +00:00
committed by Compute-Runtime-Automation
parent 5d1c3c98a4
commit 06eaef0352
14 changed files with 240 additions and 51 deletions

View File

@@ -635,6 +635,7 @@ bool ModuleImp::linkBinary() {
Linker::SegmentInfo globals;
Linker::SegmentInfo constants;
Linker::SegmentInfo exportedFunctions;
Linker::SegmentInfo strings;
GraphicsAllocation *globalsForPatching = translationUnit->globalVarBuffer;
GraphicsAllocation *constantsForPatching = translationUnit->globalConstBuffer;
if (globalsForPatching != nullptr) {
@@ -645,6 +646,10 @@ bool ModuleImp::linkBinary() {
constants.gpuAddress = static_cast<uintptr_t>(constantsForPatching->getGpuAddress());
constants.segmentSize = constantsForPatching->getUnderlyingBufferSize();
}
if (translationUnit->programInfo.globalStrings.initData != nullptr) {
strings.gpuAddress = reinterpret_cast<uintptr_t>(translationUnit->programInfo.globalStrings.initData);
strings.segmentSize = translationUnit->programInfo.globalStrings.size;
}
if (linkerInput->getExportedFunctionsSegmentId() >= 0) {
auto exportedFunctionHeapId = linkerInput->getExportedFunctionsSegmentId();
this->exportedFunctionsSurface = this->kernelImmDatas[exportedFunctionHeapId]->getIsaGraphicsAllocation();
@@ -663,7 +668,7 @@ bool ModuleImp::linkBinary() {
}
}
auto linkStatus = linker.link(globals, constants, exportedFunctions,
auto linkStatus = linker.link(globals, constants, exportedFunctions, strings,
globalsForPatching, constantsForPatching,
isaSegmentsForPatching, unresolvedExternalsInfo, this->device->getNEODevice(),
translationUnit->programInfo.globalConstants.initData,