diff --git a/projects/rocr-runtime/runtime/hsa-runtime/inc/amd_hsa_elf.h b/projects/rocr-runtime/runtime/hsa-runtime/inc/amd_hsa_elf.h index b71b4df27a..74f15d7d7a 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/inc/amd_hsa_elf.h +++ b/projects/rocr-runtime/runtime/hsa-runtime/inc/amd_hsa_elf.h @@ -204,6 +204,15 @@ enum : unsigned { EF_AMDGPU_GENERIC_VERSION_MAX = 0xff, }; +// ELF Relocation types for AMDGPU. +enum : unsigned { + R_AMDGPU_ABS32_LO = 1, + R_AMDGPU_ABS32_HI = 2, + R_AMDGPU_ABS64 = 3, + R_AMDGPU_ABS32 = 6, + R_AMDGPU_RELATIVE64 = 13, +}; + } // end namespace ELF // ELF Section Header Flag Enumeration Values. diff --git a/projects/rocr-runtime/runtime/hsa-runtime/loader/executable.cpp b/projects/rocr-runtime/runtime/hsa-runtime/loader/executable.cpp index f272b49cad..3ec9c32c77 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/loader/executable.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/loader/executable.cpp @@ -1833,7 +1833,7 @@ hsa_status_t ExecutableImpl::ApplyDynamicRelocation(hsa_agent_t agent, amd::hsa: symAddr += rel->addend(); switch (rel->type()) { - case R_AMDGPU_V1_32_HIGH: + case ELF::R_AMDGPU_ABS32_HI: { if (!symAddr) { logger_ << "LoaderError: symbol \"" << rel->symbol()->name() << "\" is undefined\n"; @@ -1845,7 +1845,7 @@ hsa_status_t ExecutableImpl::ApplyDynamicRelocation(hsa_agent_t agent, amd::hsa: break; } - case R_AMDGPU_V1_32_LOW: + case ELF::R_AMDGPU_ABS32_LO: { if (!symAddr) { logger_ << "LoaderError: symbol \"" << rel->symbol()->name() << "\" is undefined\n"; @@ -1857,7 +1857,7 @@ hsa_status_t ExecutableImpl::ApplyDynamicRelocation(hsa_agent_t agent, amd::hsa: break; } - case R_AMDGPU_V1_64: + case ELF::R_AMDGPU_ABS64: { if (!symAddr) { logger_ << "LoaderError: symbol \"" << rel->symbol()->name() << "\" is undefined\n"; @@ -1868,7 +1868,7 @@ hsa_status_t ExecutableImpl::ApplyDynamicRelocation(hsa_agent_t agent, amd::hsa: break; } - case R_AMDGPU_V1_RELATIVE64: + case ELF::R_AMDGPU_RELATIVE64: { int64_t baseDelta = reinterpret_cast(relSeg->Address(0)) - relSeg->VAddr(); uint64_t relocatedAddr = baseDelta + rel->addend();