From 8bee6e49760384b6fcb903118b645a56241b484d Mon Sep 17 00:00:00 2001 From: Konstantin Zhuravlyov Date: Fri, 18 Jan 2019 15:42:28 -0500 Subject: [PATCH] Loader: update symbol processing for v2+ - Skip symbols that are STB_LOCAL and not STT_AMDGPU_HSA_KERNEL Change-Id: I68567f58de9bf3f07dbd8020ef63f47667c86367 --- runtime/hsa-runtime/loader/executable.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/runtime/hsa-runtime/loader/executable.cpp b/runtime/hsa-runtime/loader/executable.cpp index c3814813cd..de439cc9df 100644 --- a/runtime/hsa-runtime/loader/executable.cpp +++ b/runtime/hsa-runtime/loader/executable.cpp @@ -1148,6 +1148,11 @@ hsa_status_t ExecutableImpl::LoadCodeObject( if (status != HSA_STATUS_SUCCESS) return status; for (size_t i = 0; i < code->SymbolCount(); ++i) { + if (majorVersion >= 2 && + code->GetSymbol(i)->elfSym()->type() != STT_AMDGPU_HSA_KERNEL && + code->GetSymbol(i)->elfSym()->binding() == STB_LOCAL) + continue; + status = LoadSymbol(agent, code->GetSymbol(i), majorVersion); if (status != HSA_STATUS_SUCCESS) { return status; } }