[llvm] e96889d - Revert "Fix compression header size check in ELF writer (#66888)"

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 6 05:33:04 PST 2023


Author: Hans Wennborg
Date: 2023-11-06T14:32:24+01:00
New Revision: e96889d36f4528127e649bb90125094c75aa1628

URL: https://github.com/llvm/llvm-project/commit/e96889d36f4528127e649bb90125094c75aa1628
DIFF: https://github.com/llvm/llvm-project/commit/e96889d36f4528127e649bb90125094c75aa1628.diff

LOG: Revert "Fix compression header size check in ELF writer (#66888)"

This broke lit tests in zstd enabled builds, see comment on the PR.

> The test had 32-bit and 64-bit header sizes the wrong way around.

This reverts commit c5ecf5a130f087f493802800f3565c7bb75c238a.

Added: 
    

Modified: 
    llvm/lib/MC/ELFObjectWriter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index e4d18d8a7dd5b54..8490fefe7ff5351 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::Elf64_Chdr) : sizeof(ELF::Elf32_Chdr);
+      is64Bit() ? sizeof(ELF::Elf32_Chdr) : sizeof(ELF::Elf64_Chdr);
   if (Size <= HdrSize + CompressedContents.size())
     return false;
   // Platform specific header is followed by compressed data.


        


More information about the llvm-commits mailing list