[all-commits] [llvm/llvm-project] 450011: [Offload] Make compressed offload bundle header li...
michaelselehov via All-commits
all-commits at lists.llvm.org
Thu Jul 9 03:29:43 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 4500116810d69622da80469993ca4d1e2e9ae2c8
https://github.com/llvm/llvm-project/commit/4500116810d69622da80469993ca4d1e2e9ae2c8
Author: michaelselehov <michael.selehov at amd.com>
Date: 2026-07-09 (Thu, 09 Jul 2026)
Changed paths:
M llvm/lib/Object/OffloadBundle.cpp
M llvm/test/tools/llvm-objdump/Offloading/fatbin-coff-compress.test
Log Message:
-----------
[Offload] Make compressed offload bundle header little-endian (#206744)
The compressed offload bundle (CCOB) header integer fields (Version,
Method, FileSize, UncompressedFileSize, Hash) were serialized and read
in
host-native byte order. The on-disk format is little-endian, so on
big-endian hosts these fields were byte-swapped: writing produced a
malformed header, and reading misparsed the size, making
`llvm-objdump --offloading` crash/misbehave on s390x. This is also why
the
earlier bundle-size fix had to be reverted.
Make the header little-endian on every host:
- Read side: declare the `RawCompressedBundleHeader` fields as
`support::ulittle16_t` / `ulittle32_t` / `ulittle64_t`, so the bytes are
always interpreted as little-endian regardless of host.
- Write side: emit the header with
`support::endian::Writer(OS, endianness::little)` instead of host-native
`OS.write(&field, sizeof field)`.
Also revert the temporary big-endian test skip added in #205999
(host-byteorder-little-endian guard on fatbin-coff-compress.test): with
the
header now little-endian, the test runs correctly on big-endian hosts.
---------
Co-authored-by: Michael Selehov <michael.selehov at amd.com>
Co-authored-by: Nikita Popov <npopov at redhat.com> (LE approach)
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list