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;