diff options
author | Yaxun (Sam) Liu <yaxun.liu@amd.com> | 2023-10-05 10:19:13 -0400 |
---|---|---|
committer | Yaxun (Sam) Liu <yaxun.liu@amd.com> | 2023-10-05 11:20:46 -0400 |
commit | 7e2823438e920d25364ff92b62ad90020c31bb59 (patch) | |
tree | a6bc9c265533a6be0afb08c2eb6c3893147afc15 /llvm/lib/Object/Binary.cpp | |
parent | 4732b0cbc0ab123479084184305fb2873e221780 (diff) | |
download | llvm-7e2823438e920d25364ff92b62ad90020c31bb59.zip llvm-7e2823438e920d25364ff92b62ad90020c31bb59.tar.gz llvm-7e2823438e920d25364ff92b62ad90020c31bb59.tar.bz2 |
Reland "[HIP] Support compressing device binary"
Original PR: https://github.com/llvm/llvm-project/pull/67162
The commit was reverted due to UB detected by santizer:
https://lab.llvm.org/buildbot/#/builders/238/builds/5955
clang/lib/Driver/OffloadBundler.cpp:1012:25: runtime error:
load of misaligned address 0xaaaae2d90e7c for type
'const uint64_t' (aka 'const unsigned long'), which
requires 8 byte alignment
It was fixed by using memcpy instead of dereferencing int*
casted from unaligned char*.
Diffstat (limited to 'llvm/lib/Object/Binary.cpp')
-rw-r--r-- | llvm/lib/Object/Binary.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Object/Binary.cpp b/llvm/lib/Object/Binary.cpp index d18aed8..0ee9f7f 100644 --- a/llvm/lib/Object/Binary.cpp +++ b/llvm/lib/Object/Binary.cpp @@ -87,6 +87,8 @@ Expected<std::unique_ptr<Binary>> object::createBinary(MemoryBufferRef Buffer, case file_magic::cuda_fatbinary: case file_magic::coff_cl_gl_object: case file_magic::dxcontainer_object: + case file_magic::offload_bundle: + case file_magic::offload_bundle_compressed: // Unrecognized object file format. return errorCodeToError(object_error::invalid_file_type); case file_magic::offload_binary: |