[hsa-runtime] Add support to hsa-runtime to find symbols from ".dynsym" section.

Earlier, hsa-runtime was unable to find symbols from a stripped ELF-image becasue
no support to find symbols from ".dynsym" section.

Looking for symbols in .dynsym is enabled by LOADER_USE_DYNSYM=1
environment variable

Change-Id: I4f0e8dd0eb053a6066d4d49b670c52e51149531a


[ROCm/ROCR-Runtime commit: 4142a77375]
This commit is contained in:
raghavmedicherla
2022-12-08 16:50:43 -05:00
committed by Konstantin Zhuravlyov
parent 8c3acb3974
commit 2758da98cd
3 changed files with 44 additions and 4 deletions
@@ -1765,8 +1765,8 @@ namespace code {
hsatext = sec;
}
}
for (size_t i = 0; i < img->symtab()->symbolCount(); ++i) {
amd::elf::Symbol* elfsym = img->symtab()->symbol(i);
for (size_t i = 0; i < img->getSymbolTable()->symbolCount(); ++i) {
amd::elf::Symbol* elfsym = img->getSymbolTable()->symbol(i);
Symbol* sym = 0;
switch (elfsym->type()) {
case STT_AMDGPU_HSA_KERNEL: {