[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
This commit is contained in:
raghavmedicherla
2022-12-05 14:37:29 -05:00
parent e39ad34d9c
commit 5727a10a1b
@@ -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<GElfSection>& section = sections[i];
if (section->Name() == ".strtab") { strtabSection = static_cast<GElfStringTable*>(section.get()); }
if (section->Name() == ".symtab") { symtabSection = static_cast<GElfSymbolTable*>(section.get()); }
if (section->Name() == ".note") { noteSection = static_cast<GElfNoteSection*>(section.get()); }
if (section->type() == SHT_STRTAB) { strtabSection = static_cast<GElfStringTable*>(section.get()); }
if (section->type() == SHT_SYMTAB) { symtabSection = static_cast<GElfSymbolTable*>(section.get()); }
if (section->type() == SHT_NOTE) { noteSection = static_cast<GElfNoteSection*>(section.get()); }
}
size_t phnum;