diff --git a/openmp/libomptarget/plugins-nextgen/amdgpu/utils/UtilitiesRTL.h b/openmp/libomptarget/plugins-nextgen/amdgpu/utils/UtilitiesRTL.h index cdf1d10980e9a..ba2262a59b604 100644 --- a/openmp/libomptarget/plugins-nextgen/amdgpu/utils/UtilitiesRTL.h +++ b/openmp/libomptarget/plugins-nextgen/amdgpu/utils/UtilitiesRTL.h @@ -160,13 +160,13 @@ class KernelInfoReader { /// Process ELF note to read AMDGPU metadata from respective information /// fields. - Error processNote(const object::ELF64LE::Note &Note) { + Error processNote(const object::ELF64LE::Note &Note, size_t Align) { if (Note.getName() != "AMDGPU") return Error::success(); // We are not interested in other things assert(Note.getType() == ELF::NT_AMDGPU_METADATA && "Parse AMDGPU MetaData"); - auto Desc = Note.getDesc(); + auto Desc = Note.getDesc(Align); StringRef MsgPackString = StringRef(reinterpret_cast(Desc.data()), Desc.size()); msgpack::Document MsgPackDoc; @@ -313,7 +313,7 @@ Error readAMDGPUMetaDataFromImage(MemoryBufferRef MemBuffer, if (Err) return Err; // Fills the KernelInfoTabel entries in the reader - if ((Err = Reader.processNote(N))) + if ((Err = Reader.processNote(N, S.sh_addralign))) return Err; } } diff --git a/openmp/libomptarget/plugins/amdgpu/impl/system.cpp b/openmp/libomptarget/plugins/amdgpu/impl/system.cpp index e8dba47b6cde0..a678bad55e2d1 100644 --- a/openmp/libomptarget/plugins/amdgpu/impl/system.cpp +++ b/openmp/libomptarget/plugins/amdgpu/impl/system.cpp @@ -197,7 +197,7 @@ findMetadata(const ELFObjectFile &ELFObj) { if (Note.getType() == NT_AMDGPU_METADATA && Note.getName() != "AMDGPU") return Failure; - ArrayRef Desc = Note.getDesc(); + ArrayRef Desc = Note.getDesc(Phdr.p_align); return {Desc.data(), Desc.data() + Desc.size()}; }