diff --git a/shared/source/device_binary_format/elf/zebin_elf.h b/shared/source/device_binary_format/elf/zebin_elf.h index 38a93c6d63..9dc6b3effe 100644 --- a/shared/source/device_binary_format/elf/zebin_elf.h +++ b/shared/source/device_binary_format/elf/zebin_elf.h @@ -38,7 +38,9 @@ static constexpr ConstStringRef dataGlobal = ".data.global"; static constexpr ConstStringRef symtab = ".symtab"; static constexpr ConstStringRef relTablePrefix = ".rel."; static constexpr ConstStringRef spv = ".spv"; +static constexpr ConstStringRef debugPrefix = ".debug_"; static constexpr ConstStringRef debugInfo = ".debug_info"; +static constexpr ConstStringRef debugAbbrev = ".debug_abbrev"; static constexpr ConstStringRef zeInfo = ".ze_info"; static constexpr ConstStringRef gtpinInfo = ".gtpin_info"; static constexpr ConstStringRef noteIntelGT = ".note.intelgt.compat"; diff --git a/shared/source/device_binary_format/zebin_decoder.cpp b/shared/source/device_binary_format/zebin_decoder.cpp index 4579f79501..2464f20f67 100644 --- a/shared/source/device_binary_format/zebin_decoder.cpp +++ b/shared/source/device_binary_format/zebin_decoder.cpp @@ -100,9 +100,10 @@ DecodeError extractZebinSections(NEO::Elf::Elf &elf, ZebinSect out.constDataSections.push_back(&elfSectionHeader); } else if (sectionName == NEO::Elf::SectionsNamesZebin::dataGlobal) { out.globalDataSections.push_back(&elfSectionHeader); - } else if (sectionName == NEO::Elf::SectionsNamesZebin::debugInfo) { + } else if (sectionName.startsWith(NEO::Elf::SectionsNamesZebin::debugPrefix.data())) { + // ignoring intentionally } else { - outErrReason.append("DeviceBinaryFormat::Zebin : Unhandled SHT_PROGBITS section : " + sectionName.str() + " currently supports only : " + NEO::Elf::SectionsNamesZebin::textPrefix.str() + "KERNEL_NAME, " + NEO::Elf::SectionsNamesZebin::dataConst.str() + ", " + NEO::Elf::SectionsNamesZebin::dataGlobal.str() + " and " + NEO::Elf::SectionsNamesZebin::debugInfo.str() + ".\n"); + outErrReason.append("DeviceBinaryFormat::Zebin : Unhandled SHT_PROGBITS section : " + sectionName.str() + " currently supports only : " + NEO::Elf::SectionsNamesZebin::textPrefix.str() + "KERNEL_NAME, " + NEO::Elf::SectionsNamesZebin::dataConst.str() + ", " + NEO::Elf::SectionsNamesZebin::dataGlobal.str() + " and " + NEO::Elf::SectionsNamesZebin::debugPrefix.str() + "* .\n"); return DecodeError::InvalidBinary; } break; diff --git a/shared/test/unit_test/device_binary_format/zebin_decoder_tests.cpp b/shared/test/unit_test/device_binary_format/zebin_decoder_tests.cpp index ba7c1e785f..00bd0fda15 100644 --- a/shared/test/unit_test/device_binary_format/zebin_decoder_tests.cpp +++ b/shared/test/unit_test/device_binary_format/zebin_decoder_tests.cpp @@ -76,7 +76,7 @@ TEST(ExtractZebinSections, GivenUnknownElfProgbitsSectionThenFail) { auto decodeError = NEO::extractZebinSections(decodedElf, sections, errors, warnings); EXPECT_EQ(NEO::DecodeError::InvalidBinary, decodeError); EXPECT_TRUE(warnings.empty()) << warnings; - auto expectedError = "DeviceBinaryFormat::Zebin : Unhandled SHT_PROGBITS section : someSection currently supports only : .text.KERNEL_NAME, .data.const, .data.global and .debug_info.\n"; + auto expectedError = "DeviceBinaryFormat::Zebin : Unhandled SHT_PROGBITS section : someSection currently supports only : .text.KERNEL_NAME, .data.const, .data.global and .debug_* .\n"; EXPECT_STREQ(expectedError, errors.c_str()); } @@ -87,6 +87,7 @@ TEST(ExtractZebinSections, GivenKnownSectionsThenCapturesThemProperly) { elfEncoder.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Elf::SectionsNamesZebin::dataConst, std::string{}); elfEncoder.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Elf::SectionsNamesZebin::dataGlobal, std::string{}); elfEncoder.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Elf::SectionsNamesZebin::debugInfo, std::string{}); + elfEncoder.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Elf::SectionsNamesZebin::debugAbbrev, std::string{}); elfEncoder.appendSection(NEO::Elf::SHT_SYMTAB, NEO::Elf::SectionsNamesZebin::symtab, std::string{}); elfEncoder.appendSection(NEO::Elf::SHT_ZEBIN_ZEINFO, NEO::Elf::SectionsNamesZebin::zeInfo, std::string{}); elfEncoder.appendSection(NEO::Elf::SHT_ZEBIN_SPIRV, NEO::Elf::SectionsNamesZebin::spv, std::string{});