Create input for linker during zebin decoding

Remove code duplication. Parsing zebin elf for relocations and symbols
is moved to decodeSingleDeviceBinary.

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
This commit is contained in:
Krystian Chmielewski
2022-09-21 17:34:18 +00:00
committed by Compute-Runtime-Automation
parent a9bc4de8cf
commit 311b0b0020
8 changed files with 49 additions and 55 deletions

View File

@ -186,18 +186,6 @@ cl_int Program::processGenBinary(const ClDevice &clDevice) {
DeviceBinaryFormat singleDeviceBinaryFormat;
std::tie(decodeError, singleDeviceBinaryFormat) = NEO::decodeSingleDeviceBinary(programInfo, binary, decodeErrors, decodeWarnings);
if (isDeviceBinaryFormat<DeviceBinaryFormat::Zebin>(binary.deviceBinary)) {
NEO::LinkerInput::SectionNameToSegmentIdMap nameToKernelId;
uint32_t id = 0;
for (auto &kernelInfo : programInfo.kernelInfos) {
nameToKernelId[kernelInfo->kernelDescriptor.kernelMetadata.kernelName] = id;
id++;
}
programInfo.prepareLinkerInputStorage();
programInfo.linkerInput->decodeElfSymbolTableAndRelocations(programInfo.decodedElf, nameToKernelId);
}
if (decodeWarnings.empty() == false) {
PRINT_DEBUG_STRING(DebugManager.flags.PrintDebugMessages.get(), stderr, "%s\n", decodeWarnings.c_str());
}