Skip to content

Commit c5ecf5a

Browse files
authored
Fix compression header size check in ELF writer (#66888)
The test had 32-bit and 64-bit header sizes the wrong way around.
1 parent 25a2d51 commit c5ecf5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/MC/ELFObjectWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ bool ELFWriter::maybeWriteCompression(
843843
uint32_t ChType, uint64_t Size,
844844
SmallVectorImpl<uint8_t> &CompressedContents, Align Alignment) {
845845
uint64_t HdrSize =
846-
is64Bit() ? sizeof(ELF::Elf32_Chdr) : sizeof(ELF::Elf64_Chdr);
846+
is64Bit() ? sizeof(ELF::Elf64_Chdr) : sizeof(ELF::Elf32_Chdr);
847847
if (Size <= HdrSize + CompressedContents.size())
848848
return false;
849849
// Platform specific header is followed by compressed data.

0 commit comments

Comments
 (0)