From 9e8f1853971279da652b367e75df51c8c22e16de Mon Sep 17 00:00:00 2001 From: Konstantin Zhuravlyov Date: Tue, 26 Mar 2024 18:47:29 -0400 Subject: [PATCH] Add R_AMDGPU_ABS32 support Change-Id: I0ee0302d919ede44765adf02eab15015573efef2 --- runtime/hsa-runtime/loader/executable.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/runtime/hsa-runtime/loader/executable.cpp b/runtime/hsa-runtime/loader/executable.cpp index 3ec9c32c77..e251a05448 100644 --- a/runtime/hsa-runtime/loader/executable.cpp +++ b/runtime/hsa-runtime/loader/executable.cpp @@ -1857,6 +1857,18 @@ hsa_status_t ExecutableImpl::ApplyDynamicRelocation(hsa_agent_t agent, amd::hsa: break; } + case ELF::R_AMDGPU_ABS32: + { + if (!symAddr) { + logger_ << "LoaderError: symbol \"" << rel->symbol()->name() << "\" is undefined\n"; + return HSA_STATUS_ERROR_VARIABLE_UNDEFINED; + } + + uint32_t symAddr32 = uint32_t(symAddr); + relSeg->Copy(rel->offset(), &symAddr32, sizeof(symAddr32)); + break; + } + case ELF::R_AMDGPU_ABS64: { if (!symAddr) {