[llvm] c5ecf5a - Fix compression header size check in ELF writer (#66888)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 5 15:33:24 PST 2023
Author: myxoid
Date: 2023-11-05T15:33:20-08:00
New Revision: c5ecf5a130f087f493802800f3565c7bb75c238a
URL: https://github.com/llvm/llvm-project/commit/c5ecf5a130f087f493802800f3565c7bb75c238a
DIFF: https://github.com/llvm/llvm-project/commit/c5ecf5a130f087f493802800f3565c7bb75c238a.diff
LOG: Fix compression header size check in ELF writer (#66888)
The test had 32-bit and 64-bit header sizes the wrong way around.
Added:
Modified:
llvm/lib/MC/ELFObjectWriter.cpp
Removed:
################################################################################
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index 8490fefe7ff5351..e4d18d8a7dd5b54 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -843,7 +843,7 @@ bool ELFWriter::maybeWriteCompression(
uint32_t ChType, uint64_t Size,
SmallVectorImpl<uint8_t> &CompressedContents, Align Alignment) {
uint64_t HdrSize =
- is64Bit() ? sizeof(ELF::Elf32_Chdr) : sizeof(ELF::Elf64_Chdr);
+ is64Bit() ? sizeof(ELF::Elf64_Chdr) : sizeof(ELF::Elf32_Chdr);
if (Size <= HdrSize + CompressedContents.size())
return false;
// Platform specific header is followed by compressed data.
More information about the llvm-commits
mailing list