From 5727a10a1bf67d53a1ad5b29b5af988ee6fe3aa1 Mon Sep 17 00:00:00 2001 From: raghavmedicherla Date: Mon, 5 Dec 2022 14:37:29 -0500 Subject: [PATCH] [hsa-runtime] Modify elfsection checks in amd_elf_image class Modified If condition checks in GElfImage::pullElf() of amd_elf_image.cpp to check using section types instead of a string check. Change-Id: I1ab92f0a9118fb2382652a1cc900a3150cbee2da --- runtime/hsa-runtime/libamdhsacode/amd_elf_image.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/hsa-runtime/libamdhsacode/amd_elf_image.cpp b/runtime/hsa-runtime/libamdhsacode/amd_elf_image.cpp index bff3f46dd9..33871dd2b9 100644 --- a/runtime/hsa-runtime/libamdhsacode/amd_elf_image.cpp +++ b/runtime/hsa-runtime/libamdhsacode/amd_elf_image.cpp @@ -1433,9 +1433,9 @@ namespace elf { for (size_t i = 1; i < sections.size(); ++i) { if (i == ehdr.e_shstrndx || i == ehdr.e_shstrndx) { continue; } std::unique_ptr& section = sections[i]; - if (section->Name() == ".strtab") { strtabSection = static_cast(section.get()); } - if (section->Name() == ".symtab") { symtabSection = static_cast(section.get()); } - if (section->Name() == ".note") { noteSection = static_cast(section.get()); } + if (section->type() == SHT_STRTAB) { strtabSection = static_cast(section.get()); } + if (section->type() == SHT_SYMTAB) { symtabSection = static_cast(section.get()); } + if (section->type() == SHT_NOTE) { noteSection = static_cast(section.get()); } } size_t phnum;