From 8a6edb07d9bec525d5e17617c91df50fcd9ee437 Mon Sep 17 00:00:00 2001 From: Konstantin Zhuravlyov Date: Tue, 20 Jun 2023 19:48:52 -0400 Subject: [PATCH] Cache referenced symbol table when pulling data in relocation section Change-Id: I6ef21cedde1aca6fd1ec5e5d5634563f030eaab8 --- runtime/hsa-runtime/libamdhsacode/amd_elf_image.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/runtime/hsa-runtime/libamdhsacode/amd_elf_image.cpp b/runtime/hsa-runtime/libamdhsacode/amd_elf_image.cpp index 8062af901b..831c1f7a78 100644 --- a/runtime/hsa-runtime/libamdhsacode/amd_elf_image.cpp +++ b/runtime/hsa-runtime/libamdhsacode/amd_elf_image.cpp @@ -711,6 +711,10 @@ namespace elf { GElfStringTable* shstrtab() override; GElfStringTable* strtab() override; + GElfSymbolTable* getReferencedSymbolTable(uint16_t index) + { + return static_cast(section(index)); + } GElfSymbolTable* getSymtab(uint16_t index) override { if (section(index)->type() == SHT_SYMTAB) @@ -1261,7 +1265,7 @@ namespace elf { bool GElfRelocationSection::pullData() { section = elf->section(hdr.sh_info); - symtab = elf->getSymtab(hdr.sh_link); + symtab = elf->getReferencedSymbolTable(hdr.sh_link); Elf_Scn *lScn = elf_getscn(elf->e, ndxscn); assert(lScn); Elf_Data *lData = elf_getdata(lScn, nullptr);